From 02815e8bb46fffc28464162c26e98985bdfd8810 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Mon, 4 Nov 2013 04:49:58 +0100 Subject: Flush pending handlers between each include. In particular, run 'apt-get update' right after configured APT, and restart daemon right after configured them. The advantage being that if ansible crashes in some "task", the earlier would already be restarted if neeeded. (This may not happen in the next run since the configuration should already be up to date.) --- roles/common/tasks/apt.yml | 3 +++ roles/common/tasks/fail2ban.yml | 2 ++ roles/common/tasks/hosts.yml | 2 ++ roles/common/tasks/ipsec.yml | 2 ++ roles/common/tasks/rkhunter.yml | 2 ++ roles/common/tasks/samhain.yml | 2 ++ 6 files changed, 13 insertions(+) (limited to 'roles') diff --git a/roles/common/tasks/apt.yml b/roles/common/tasks/apt.yml index 030709b..d172384 100644 --- a/roles/common/tasks/apt.yml +++ b/roles/common/tasks/apt.yml @@ -39,3 +39,6 @@ service: name=cron state=started tags: - cron + +# We should run 'apt-get update' before proceeding to any other task. +- meta: flush_handlers diff --git a/roles/common/tasks/fail2ban.yml b/roles/common/tasks/fail2ban.yml index ccfeaa6..3c13d8c 100644 --- a/roles/common/tasks/fail2ban.yml +++ b/roles/common/tasks/fail2ban.yml @@ -11,3 +11,5 @@ - name: Start fail2ban service: name=fail2ban state=started + +- meta: flush_handlers diff --git a/roles/common/tasks/hosts.yml b/roles/common/tasks/hosts.yml index 18ccfd9..f818635 100644 --- a/roles/common/tasks/hosts.yml +++ b/roles/common/tasks/hosts.yml @@ -25,3 +25,5 @@ regexp="^127\.0\.1\.1\s+" line="127.0.1.1 {{ inventory_hostname }} {{ inventory_hostname_short }}" tags: hosts + +- meta: flush_handlers diff --git a/roles/common/tasks/ipsec.yml b/roles/common/tasks/ipsec.yml index 2196728..1f33946 100644 --- a/roles/common/tasks/ipsec.yml +++ b/roles/common/tasks/ipsec.yml @@ -56,3 +56,5 @@ src=/etc/network/if-up.d/ipsec dest=/etc/network/if-down.d/ipsec owner=root group=root state=link + +- meta: flush_handlers diff --git a/roles/common/tasks/rkhunter.yml b/roles/common/tasks/rkhunter.yml index 144430e..f6a4d71 100644 --- a/roles/common/tasks/rkhunter.yml +++ b/roles/common/tasks/rkhunter.yml @@ -20,3 +20,5 @@ # This might not always be necessary, but it's not like we would # change the config every day... - Update rkhunter's data file + +- meta: flush_handlers diff --git a/roles/common/tasks/samhain.yml b/roles/common/tasks/samhain.yml index 90ea754..cbc0b5e 100644 --- a/roles/common/tasks/samhain.yml +++ b/roles/common/tasks/samhain.yml @@ -18,3 +18,5 @@ - name: Start samhain service: name=samhain state=started + +- meta: flush_handlers -- cgit v1.2.3