From 662120af880623fd0ba16b83cd80320e1a3806cc Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Thu, 31 Oct 2013 03:25:01 +0100 Subject: Add a 'check' switch to the firewall. update-firewall.sh -c does not update the firewall, but returns a non-zero value iff. running it without the switch would modify it. --- roles/common/tasks/firewall.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'roles/common/tasks') diff --git a/roles/common/tasks/firewall.yml b/roles/common/tasks/firewall.yml index 2913a9e..d15384a 100644 --- a/roles/common/tasks/firewall.yml +++ b/roles/common/tasks/firewall.yml @@ -16,14 +16,17 @@ dest=/etc/iptables/services owner=root group=root mode=0600 - notify: - - Unsafe firewall update - name: Copy /usr/local/sbin/update-firewall.sh copy: src=usr/local/sbin/update-firewall.sh dest=/usr/local/sbin/update-firewall.sh owner=root group=root mode=0755 + +- name: Ensure the firewall is up to date + command: /usr/local/sbin/update-firewall.sh -c + register: rv + changed_when: rv.rc notify: - Unsafe firewall update -- cgit v1.2.3