From c1ad62d179fe978e08b39ffee1975dac596c1a7a Mon Sep 17 00:00:00 2001 From: Russell Teague Date: Wed, 23 Nov 2016 09:58:31 -0500 Subject: Systemd `systemctl show` workaround `systemctl show` would exit with RC=1 for non-existent services in v231. This caused the Ansible systemd module to exit with a failure of running the `systemctl show` command instead of exiting stating the service was not found. This change catches both failures on either older or newer versions of systemd. The change in systemd exit status could be resolved in systemd v232. https://github.com/systemd/systemd/commit/3dced37b7c2c9a5c733817569d2bbbaa397adaf7 --- roles/os_firewall/tasks/firewall/iptables.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/os_firewall/tasks/firewall/iptables.yml') diff --git a/roles/os_firewall/tasks/firewall/iptables.yml b/roles/os_firewall/tasks/firewall/iptables.yml index 704819d8a..930b32cf2 100644 --- a/roles/os_firewall/tasks/firewall/iptables.yml +++ b/roles/os_firewall/tasks/firewall/iptables.yml @@ -7,7 +7,7 @@ enabled: no masked: yes register: task_result - failed_when: "task_result|failed and 'Could not find' not in task_result.msg" + failed_when: "task_result|failed and 'could not' not in task_result.msg|lower" - name: Install iptables packages package: name={{ item }} state=present -- cgit v1.2.3