From 4ff687aa26bffc8e0dd94445ee77395327e0b179 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 31 Jul 2019 19:01:24 +0300 Subject: [PATCH] Feat: Add `init-logcheck` Fast version of role logcheck to be used in dependencies. --- playbooks/debian/roles/apache/meta/main.yml | 2 +- playbooks/debian/roles/init-logcheck/README.txt | 1 + playbooks/debian/roles/init-logcheck/tasks/main.yml | 10 ++++++++++ playbooks/debian/roles/named/meta/main.yml | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 playbooks/debian/roles/init-logcheck/README.txt create mode 100644 playbooks/debian/roles/init-logcheck/tasks/main.yml diff --git a/playbooks/debian/roles/apache/meta/main.yml b/playbooks/debian/roles/apache/meta/main.yml index d2e2f89..1d59f7a 100644 --- a/playbooks/debian/roles/apache/meta/main.yml +++ b/playbooks/debian/roles/apache/meta/main.yml @@ -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 index 0000000..7bd10c2 --- /dev/null +++ b/playbooks/debian/roles/init-logcheck/README.txt @@ -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 index 0000000..a0960a5 --- /dev/null +++ b/playbooks/debian/roles/init-logcheck/tasks/main.yml @@ -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 diff --git a/playbooks/debian/roles/named/meta/main.yml b/playbooks/debian/roles/named/meta/main.yml index d2e2f89..1d59f7a 100644 --- a/playbooks/debian/roles/named/meta/main.yml +++ b/playbooks/debian/roles/named/meta/main.yml @@ -1 +1 @@ -dependencies: ['init-system', 'firewall', 'logcheck'] +dependencies: ['init-system', 'firewall', 'init-logcheck'] -- 2.39.5