Add skips for firewalld when systemd is missing 13/57513/1
authorDaniel Farrell <dfarrell@redhat.com>
Thu, 13 Aug 2015 18:05:34 +0000 (14:05 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Fri, 19 May 2017 16:52:24 +0000 (12:52 -0400)
Change-Id: I92617366e70cb0341af98a8b775a3de82ce6cb11
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
tasks/is_systemd_installed.yml [new file with mode: 0644]
tasks/open_nb_rest_port.yml
tasks/start_odl.yml

diff --git a/tasks/is_systemd_installed.yml b/tasks/is_systemd_installed.yml
new file mode 100644 (file)
index 0000000..1666eb7
--- /dev/null
@@ -0,0 +1,5 @@
+---
+- name: Check if systemd is installed
+  command: rpm -q systemd
+  changed_when: false
+  register: systemd_installed
index e6f8632be5677e816dcf1da61c0f619d4e2bcc94..fc6de5643a3e8e6a8de1185f92438f640d464457 100644 (file)
@@ -1,11 +1,15 @@
+---
+- include: is_systemd_installed.yml
+
 - name: Check if FirewallD service is running
   command: systemctl is-active firewalld
   failed_when: firewalld_status.stdout not in ['unknown', 'active']
   changed_when: false
   register: firewalld_status
+  when: systemd_installed.rc == 0
 
 - name: Open ODL NB REST port via FirewallD
-  when: firewalld_status.stdout == 'active'
+  when: systemd_installed.rc == 0 and firewalld_status.stdout == 'active'
   firewalld:
     port={{ nb_rest_port }}/tcp
     state=enabled
index 3abbdfddddebc864900775b81d874032e792bbf6..bb9c4e93f55de7eea688bf741cb7e0500efa3805 100644 (file)
@@ -1,7 +1,5 @@
 ---
-- name: Check if systemd is installed
-  command: rpm -q systemd
-  register: systemd_installed
+- include: is_systemd_installed.yml
 
 - include: start_odl_systemd_service.yml
-  when: systemd_installed.rc == 1
+  when: systemd_installed.rc == 0