diff --git a/playbooks/groups/copr-keygen.yml b/playbooks/groups/copr-keygen.yml
index f2e870bf42..4ec2e5afe4 100644
--- a/playbooks/groups/copr-keygen.yml
+++ b/playbooks/groups/copr-keygen.yml
@@ -18,7 +18,7 @@
     register: facts
   - name: install python2 and dnf stuff
     raw: dnf -y install python-dnf libselinux-python yum
-    when: facts|failed
+    when: facts is failed
 
 - name: cloud basic setup
   hosts: copr-keygen-stg:copr-keygen
diff --git a/playbooks/transient_cloud_instance.yml b/playbooks/transient_cloud_instance.yml
index 3f4682823f..3ce042cf7b 100644
--- a/playbooks/transient_cloud_instance.yml
+++ b/playbooks/transient_cloud_instance.yml
@@ -53,7 +53,7 @@
 
   - name: install python2 and dnf stuff
     raw: dnf -y install python-dnf libselinux-python
-    when: facts|failed
+    when: facts is failed
 
 - name: provision instance
   hosts: tmp_just_created
diff --git a/roles/dnf-automatic/tasks/main.yml b/roles/dnf-automatic/tasks/main.yml
index a8482911d2..e86d666715 100644
--- a/roles/dnf-automatic/tasks/main.yml
+++ b/roles/dnf-automatic/tasks/main.yml
@@ -39,7 +39,7 @@
 
   - name: start dnf-automatic.timer if it is not active
     command: systemctl start dnf-automatic.timer
-    when: automaticative|failed and ansible_distribution_major_version|int < 26
+    when: automaticative is failed and ansible_distribution_major_version|int < 26
 
   - name: enable and start dnf-automatic f26+
     command: systemctl enable dnf-automatic-install.timer
@@ -59,7 +59,7 @@
 
   - name: start dnf-automatic-install.timer if it is not active
     command: systemctl start dnf-automatic-install.timer
-    when: automaticative|failed and ansible_distribution_major_version|int >= 26
+    when: automaticative is failed and ansible_distribution_major_version|int >= 26
 
   - name: disable silly makecache timer
     systemd: name=dnf-makecache masked=yes
diff --git a/roles/nginx/tasks/ssl-setup.yml b/roles/nginx/tasks/ssl-setup.yml
index 2fbc5ffc97..0d3254d67b 100644
--- a/roles/nginx/tasks/ssl-setup.yml
+++ b/roles/nginx/tasks/ssl-setup.yml
@@ -31,7 +31,7 @@
   command: openssl req -new -nodes -x509 -subj "{{ ssl_self_signed_string }}" -days 3650 -keyout /etc/nginx/conf.d/ssl.key -out /etc/nginx/conf.d/ssl.pem -extensions v3_ca
   args:
     creates: /etc/nginx/conf.d/ssl.pem
-  when: setup_ssl_key|failed or setup_ssl_pem|failed
+  when: setup_ssl_key is failed or setup_ssl_pem is failed
 
 - name: warn that the next step takes a while
   debug:
diff --git a/tasks/persistent_cloud.yml b/tasks/persistent_cloud.yml
index 6411c4e44b..88cd56a85b 100644
--- a/tasks/persistent_cloud.yml
+++ b/tasks/persistent_cloud.yml
@@ -26,7 +26,7 @@
       floating_ips:
         - "{{public_ip}}"
   register: nova_result
-  when: host_is_up|failed
+  when: host_is_up is failed
 
 # instance can be both id and name, volume must be id
 # volume must be id
@@ -53,27 +53,27 @@
 
 - name: wait for he host to be hot
   local_action: wait_for host={{ public_ip }} port=22 delay=1 timeout=600
-  when: host_is_up|failed
+  when: host_is_up is failed
 
 # SSH is up and running, however cloud-init still did not deployed ssh keypair
 # we have to wait some time. 10 sec is usually enough, but not always.
 
 - name: waiting for cloud-init
   pause: seconds=30
-  when: host_is_up|failed
+  when: host_is_up is failed
 
 - name: gather ssh host key from new instance
   local_action: command ssh-keyscan -t rsa {{ inventory_hostname }}
   ignore_errors: True
   register: hostkey
-  when: host_is_up|failed
+  when: host_is_up is failed
 
 - name: add new ssh host key (until we can sign it)
   local_action: known_hosts path={{item}} key="{{ hostkey.stdout }}" host={{ inventory_hostname }} state=present
   ignore_errors: True
   with_items:
   - /root/.ssh/known_hosts
-  when: host_is_up|failed
+  when: host_is_up is failed
 
 #
 # Next we try and gather facts. If the host doesn't have python2 this will fail.