Use task conditionals that work with Fedora 22+ 41/57541/1
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 20 May 2016 19:07:38 +0000 (15:07 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Fri, 19 May 2017 16:52:26 +0000 (12:52 -0400)
Not sure if it was an Ansible or Ruby update that changed this, but
conditionals of the form `x in [1, 2]` fail with errors related to
template parsing. Changed the conditionals to logically equivalent ones
that use simple equality and conjunction.

Fixes #23

Change-Id: I4f76cc32fb6cd34253cd0b6374a933097ae04985
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
tasks/in_container.yml
tasks/open_nb_rest_port.yml

index 922637b1194c1cdf240469458206fdd73482b364..b8052298d77b77c133c03fe4771326437d88585a 100644 (file)
@@ -1,6 +1,6 @@
 ---
 - name: Check if in a container
   command: grep -q docker /proc/1/cgroup
-  failed_when: in_container.rc not in [0, 1]
+  failed_when: in_container.rc != 0 and in_container.rc !=1
   changed_when: false
   register: in_container
index 1a94f9c7a4b32955a9d4352511c87bb6cd285a93..58c4796e1c33c984427def73dd3360a64a8b9ecd 100644 (file)
@@ -3,7 +3,7 @@
 
 - name: Check if FirewallD service is running
   command: systemctl is-active firewalld
-  failed_when: firewalld_status.stdout not in ['unknown', 'active']
+  failed_when: firewalld_status.stdout != 'unknown' and firewalld_status.stdout != 'active'
   changed_when: false
   register: firewalld_status
   when: in_container.rc == 1