]> git.phdru.name Git - ansible.git/commitdiff
Feat: Add `init-logcheck`
authorOleg Broytman <phd@phdru.name>
Wed, 31 Jul 2019 16:01:24 +0000 (19:01 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 31 Jul 2019 16:33:57 +0000 (19:33 +0300)
Fast version of role logcheck to be used in dependencies.

playbooks/debian/roles/apache/meta/main.yml
playbooks/debian/roles/init-logcheck/README.txt [new file with mode: 0644]
playbooks/debian/roles/init-logcheck/tasks/main.yml [new file with mode: 0644]
playbooks/debian/roles/named/meta/main.yml

index d2e2f89f7e04110f4a3d0d1acd84f729131f6d4d..1d59f7a342b3a641d88c132d7ded2006c16a5a90 100644 (file)
@@ -1 +1 @@
-dependencies: ['init-system', 'firewall', 'logcheck']
+dependencies: ['init-system', 'firewall', 'init-logcheck']
diff --git a/playbooks/debian/roles/init-logcheck/README.txt b/playbooks/debian/roles/init-logcheck/README.txt
new file mode 100644 (file)
index 0000000..7bd10c2
--- /dev/null
@@ -0,0 +1 @@
+Fast version of role logcheck - it just checks if logcheck is installed.
diff --git a/playbooks/debian/roles/init-logcheck/tasks/main.yml b/playbooks/debian/roles/init-logcheck/tasks/main.yml
new file mode 100644 (file)
index 0000000..a0960a5
--- /dev/null
@@ -0,0 +1,10 @@
+- name: Check logcheck
+  stat:
+    path: /etc/logcheck/logcheck.conf
+  register: logcheck_exists
+  changed_when: not logcheck_exists.stat.exists
+
+- name: Install logcheck if not installed
+  import_role:
+    name: logcheck
+  when: not logcheck_exists.stat.exists
index d2e2f89f7e04110f4a3d0d1acd84f729131f6d4d..1d59f7a342b3a641d88c132d7ded2006c16a5a90 100644 (file)
@@ -1 +1 @@
-dependencies: ['init-system', 'firewall', 'logcheck']
+dependencies: ['init-system', 'firewall', 'init-logcheck']