diff --git a/docker/services/aodh-api.yaml b/docker/services/aodh-api.yaml
index 86485bed8d..9a26ca138c 100644
--- a/docker/services/aodh-api.yaml
+++ b/docker/services/aodh-api.yaml
@@ -180,9 +180,15 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if aodh api is running"
           shell: systemctl status 'httpd' | grep -q aodh
           tags: validation
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop and disable aodh service (running under httpd)
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
           service: name=httpd state=stopped enabled=no
         - name: Set fact for removal of openstack-aodh-api package
           when: step|int == 2
@@ -191,6 +197,8 @@ outputs:
         - name: Remove openstack-aodh-api package if operator requests it
           yum: name=openstack-aodh-api state=removed
           ignore_errors: True
-          when: (remove_aodh_api_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_aodh_api_package|bool
       metadata_settings:
         get_attr: [AodhApiPuppetBase, role_data, metadata_settings]
diff --git a/docker/services/aodh-evaluator.yaml b/docker/services/aodh-evaluator.yaml
index 09f22b2391..7c5f58c684 100644
--- a/docker/services/aodh-evaluator.yaml
+++ b/docker/services/aodh-evaluator.yaml
@@ -130,10 +130,14 @@ outputs:
           register: aodh_evaluator_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-evaluator is running"
           command: systemctl is-active --quiet openstack-aodh-evaluator
-          when: (aodh_evaluator_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - aodh_evaluator_enabled.rc == 0
           tags: validation
         - name: Stop and disable openstack-aodh-evaluator service
-          when: (aodh_evaluator_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - aodh_evaluator_enabled.rc == 0
           service: name=openstack-aodh-evaluator.service state=stopped enabled=no
         - name: Set fact for removal of openstack-aodh-evaluator package
           when: step|int == 2
@@ -142,4 +146,6 @@ outputs:
         - name: Remove openstack-aodh-evaluator package if operator requests it
           yum: name=openstack-aodh-evaluator state=removed
           ignore_errors: True
-          when: (remove_aodh_evaluator_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_aodh_evaluator_package|bool
diff --git a/docker/services/aodh-listener.yaml b/docker/services/aodh-listener.yaml
index 29feab56a3..70221b51ad 100644
--- a/docker/services/aodh-listener.yaml
+++ b/docker/services/aodh-listener.yaml
@@ -130,10 +130,14 @@ outputs:
           register: aodh_listener_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-listener is running"
           command: systemctl is-active --quiet openstack-aodh-listener
-          when: (aodh_listener_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - aodh_listener_enabled.rc == 0
           tags: validation
         - name: Stop and disable openstack-aodh-listener service
-          when: (aodh_listener_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - aodh_listener_enabled.rc == 0
           service: name=openstack-aodh-listener.service state=stopped enabled=no
         - name: Set fact for removal of openstack-aodh-listener package
           when: step|int == 2
@@ -142,4 +146,6 @@ outputs:
         - name: Remove openstack-aodh-listener package if operator requests it
           yum: name=openstack-aodh-listener state=removed
           ignore_errors: True
-          when: (remove_aodh_listener_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_aodh_listener_package|bool
diff --git a/docker/services/aodh-notifier.yaml b/docker/services/aodh-notifier.yaml
index f9cf4e959d..296a0bf954 100644
--- a/docker/services/aodh-notifier.yaml
+++ b/docker/services/aodh-notifier.yaml
@@ -130,10 +130,14 @@ outputs:
           register: aodh_notifier_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-notifier is running"
           command: systemctl is-active --quiet openstack-aodh-notifier
-          when: (aodh_notifier_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - aodh_notifier_enabled.rc == 0
           tags: validation
         - name: Stop and disable openstack-aodh-notifier service
-          when: (aodh_notifier_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - aodh_notifier_enabled.rc == 0
           service: name=openstack-aodh-notifier.service state=stopped enabled=no
         - name: Set fact for removal of openstack-aodh-notifier package
           when: step|int == 2
@@ -142,4 +146,6 @@ outputs:
         - name: Remove openstack-aodh-notifier package if operator requests it
           yum: name=openstack-aodh-notifier state=removed
           ignore_errors: True
-          when: (remove_aodh_notifier_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_aodh_notifier_package|bool
diff --git a/docker/services/barbican-api.yaml b/docker/services/barbican-api.yaml
index e8e02745ac..5e28950bb5 100644
--- a/docker/services/barbican-api.yaml
+++ b/docker/services/barbican-api.yaml
@@ -214,9 +214,13 @@ outputs:
           register: barbican_enabled
         - name: "PreUpgrade step0,validation: Check service barbican-api is running"
           command: systemctl is-active --quiet openstack-barbican-api
-          when: (barbican_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - barbican_enabled.rc == 0
         - name: Stop and disable barbican_api service
-          when: (barbican_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - barbican_enabled.rc == 0
           service: name=openstack-barbican-api state=stopped enabled=no
         - name: Set fact for removal of openstack-barbican-api package
           when: step|int == 2
@@ -225,6 +229,8 @@ outputs:
         - name: Remove openstack-barbican-api package if operator requests it
           yum: name=openstack-barbican-api state=removed
           ignore_errors: True
-          when: (remove_barbican_api_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_barbican_api_package|bool
       metadata_settings:
         get_attr: [BarbicanApiBase, role_data, metadata_settings]
diff --git a/docker/services/ceilometer-agent-central.yaml b/docker/services/ceilometer-agent-central.yaml
index 399e8bd76c..a4869964c7 100644
--- a/docker/services/ceilometer-agent-central.yaml
+++ b/docker/services/ceilometer-agent-central.yaml
@@ -144,11 +144,15 @@ outputs:
           register: ceilometer_agent_central_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-central is running"
           command: systemctl is-active --quiet openstack-ceilometer-central
-          when: (ceilometer_agent_central_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ceilometer_agent_central_enabled.rc == 0
           tags: validation
         - name: Stop and disable ceilometer agent central service
           service: name=openstack-ceilometer-central state=stopped enabled=no
-          when: (ceilometer_agent_central_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ceilometer_agent_central_enabled.rc == 0
         - name: Set fact for removal of openstack-ceilometer-central package
           when: step|int == 2
           set_fact:
@@ -156,4 +160,6 @@ outputs:
         - name: Remove openstack-ceilometer-central package if operator requests it
           yum: name=openstack-ceilometer-central state=removed
           ignore_errors: True
-          when: (remove_ceilometer_central_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_ceilometer_central_package|bool
diff --git a/docker/services/ceilometer-agent-compute.yaml b/docker/services/ceilometer-agent-compute.yaml
index 9fa9fac445..0c2f5ffc6d 100644
--- a/docker/services/ceilometer-agent-compute.yaml
+++ b/docker/services/ceilometer-agent-compute.yaml
@@ -122,18 +122,26 @@ outputs:
           register: openstack_ceilometer_polling_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-compute is running"
           command: systemctl is-active --quiet openstack-ceilometer-compute
-          when: (openstack_ceilometer_compute_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - openstack_ceilometer_compute_enabled.rc == 0
           tags: validation
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-polling is running"
           command: systemctl is-active --quiet openstack-ceilometer-polling
-          when: (openstack_ceilometer_polling_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - openstack_ceilometer_polling_enabled.rc == 0
           tags: validation
         - name: Stop and disable ceilometer compute agent
           service: name=openstack-ceilometer-compute state=stopped enabled=no
-          when: (openstack_ceilometer_compute_enabled.rc|default('') == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - openstack_ceilometer_compute_enabled.rc|default('') == 0
         - name: Stop and disable ceilometer polling agent
           service: name=openstack-ceilometer-polling state=stopped enabled=no
-          when: (openstack_ceilometer_polling_enabled.rc|default('') == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - openstack_ceilometer_polling_enabled.rc|default('') == 0
         - name: Set fact for removal of openstack-ceilometer-compute and polling package
           when: step|int == 2
           set_fact:
@@ -141,8 +149,12 @@ outputs:
         - name: Remove openstack-ceilometer-compute package if operator requests it
           yum: name=openstack-ceilometer-compute state=removed
           ignore_errors: True
-          when: (remove_ceilometer_compute_polling_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_ceilometer_compute_polling_package|bool
         - name: Remove openstack-ceilometer-polling package if operator requests it
           yum: name=openstack-ceilometer-polling state=removed
           ignore_errors: True
-          when: (remove_ceilometer_compute_polling_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_ceilometer_compute_polling_package|bool
diff --git a/docker/services/ceilometer-agent-ipmi.yaml b/docker/services/ceilometer-agent-ipmi.yaml
index 0fa72e9b06..741a61ef63 100644
--- a/docker/services/ceilometer-agent-ipmi.yaml
+++ b/docker/services/ceilometer-agent-ipmi.yaml
@@ -125,11 +125,15 @@ outputs:
           register: ceilometer_ipmi_enabled
         - name: "PreUpgrade step0,validation: Check if openstack-ceilometer-ipmi is running"
           command: systemctl is-active --quiet openstack-ceilometer-ipmi
-          when: (ceilometer_ipmi_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ceilometer_ipmi_enabled.rc == 0
           tags: validation
         - name: Stop and disable ceilometer agent ipmi service
           service: name=openstack-ceilometer-agent-ipmi state=stopped enabled=no
-          when: (ceilometer_ipmi_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ceilometer_ipmi_enabled.rc == 0
         - name: Set fact for removal of openstack-ceilometer-ipmi package
           when: step|int == 2
           set_fact:
@@ -137,4 +141,6 @@ outputs:
         - name: Remove openstack-ceilometer-ipmi package if operator requests it
           yum: name=openstack-ceilometer-ipmi state=removed
           ignore_errors: True
-          when: (remove_ceilometer_ipmi_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_ceilometer_ipmi_package|bool
diff --git a/docker/services/ceilometer-agent-notification.yaml b/docker/services/ceilometer-agent-notification.yaml
index b80dfe3253..5891c64a87 100644
--- a/docker/services/ceilometer-agent-notification.yaml
+++ b/docker/services/ceilometer-agent-notification.yaml
@@ -135,11 +135,15 @@ outputs:
           register: ceilometer_agent_notification_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-notification is running"
           command: systemctl is-active --quiet openstack-ceilometer-notification
-          when: (ceilometer_agent_notification_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ceilometer_agent_notification_enabled.rc == 0
           tags: validation
         - name: Stop and disable ceilometer agent notification service
           service: name=openstack-ceilometer-notification state=stopped enabled=no
-          when: (ceilometer_agent_notification_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ceilometer_agent_notification_enabled.rc == 0
         - name: Set fact for removal of openstack-ceilometer-notification package
           when: step|int == 2
           set_fact:
@@ -147,4 +151,6 @@ outputs:
         - name: Remove openstack-ceilometer-notification package if operator requests it
           yum: name=openstack-ceilometer-notification state=removed
           ignore_errors: True
-          when: (remove_ceilometer_notification_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_ceilometer_notification_package|bool
diff --git a/docker/services/cinder-api.yaml b/docker/services/cinder-api.yaml
index 53bbb97bbd..d23f5b554e 100644
--- a/docker/services/cinder-api.yaml
+++ b/docker/services/cinder-api.yaml
@@ -208,11 +208,15 @@ outputs:
           register: cinder_api_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-cinder-api is running"
           shell: systemctl is-active --quiet openstack-cinder-api
-          when: (cinder_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - cinder_api_enabled.rc == 0
           tags: validation
         - name: Stop and disable cinder_api service (pre-upgrade not under httpd)
           service: name=openstack-cinder-api state=stopped enabled=no
-          when: (cinder_api_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - cinder_api_enabled.rc == 0
         - name: check for cinder_api running under apache (post upgrade)
           shell: "httpd -t -D DUMP_VHOSTS | grep -q cinder"
           register: cinder_api_apache
@@ -220,7 +224,9 @@ outputs:
           when: step|int == 2
         - name: Stop and disable cinder_api service
           service: name=httpd state=stopped enabled=no
-          when: (cinder_api_apache.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - cinder_api_apache.rc == 0
         - name: remove old cinder cron jobs
           when: step|int == 2
           file:
@@ -233,4 +239,6 @@ outputs:
         - name: Remove httpd package if operator requests it
           yum: name=httpd state=removed
           ignore_errors: True
-          when: (remove_httpd_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_httpd_package|bool
diff --git a/docker/services/cinder-backup.yaml b/docker/services/cinder-backup.yaml
index 07f630df4f..1b4961d768 100644
--- a/docker/services/cinder-backup.yaml
+++ b/docker/services/cinder-backup.yaml
@@ -175,4 +175,6 @@ outputs:
         - name: Remove openstack-cinder package if operator requests it
           yum: name=openstack-cinder state=removed
           ignore_errors: True
-          when: (remove_cinder_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_cinder_package|bool
diff --git a/docker/services/cinder-scheduler.yaml b/docker/services/cinder-scheduler.yaml
index 11948b6af0..5467ec9198 100644
--- a/docker/services/cinder-scheduler.yaml
+++ b/docker/services/cinder-scheduler.yaml
@@ -138,10 +138,14 @@ outputs:
           register: cinder_scheduler_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-cinder-scheduler is running"
           shell: systemctl is-active --quiet openstack-cinder-scheduler
-          when: (cinder_scheduler_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - cinder_scheduler_enabled.rc == 0
           tags: validation
         - name: Stop and disable cinder_scheduler service
-          when: (cinder_scheduler_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - cinder_scheduler_enabled.rc == 0
           service: name=openstack-cinder-scheduler state=stopped enabled=no
         - name: Set fact for removal of openstack-cinder package
           when: step|int == 2
@@ -150,4 +154,6 @@ outputs:
         - name: Remove openstack-cinder package if operator requests it
           yum: name=openstack-cinder state=removed
           ignore_errors: True
-          when: (remove_cinder_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_cinder_package|bool
diff --git a/docker/services/cinder-volume.yaml b/docker/services/cinder-volume.yaml
index 79d5c20421..bb3f3e9ae4 100644
--- a/docker/services/cinder-volume.yaml
+++ b/docker/services/cinder-volume.yaml
@@ -226,10 +226,14 @@ outputs:
           register: cinder_volume_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-cinder-volume is running"
           shell: systemctl is-active --quiet openstack-cinder-volume
-          when: (cinder_volume_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - cinder_volume_enabled.rc == 0
           tags: validation
         - name: Stop and disable cinder_volume service
-          when: (cinder_volume_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - cinder_volume_enabled.rc == 0
           service: name=openstack-cinder-volume state=stopped enabled=no
         - name: Set fact for removal of openstack-cinder package
           when: step|int == 2
@@ -238,4 +242,6 @@ outputs:
         - name: Remove openstack-cinder package if operator requests it
           yum: name=openstack-cinder state=removed
           ignore_errors: True
-          when: (remove_cinder_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_cinder_package|bool
diff --git a/docker/services/collectd.yaml b/docker/services/collectd.yaml
index 933c497838..422ab3805a 100644
--- a/docker/services/collectd.yaml
+++ b/docker/services/collectd.yaml
@@ -126,10 +126,14 @@ outputs:
           register: collectd_enabled
         - name: "PreUpgrade step0,validation: Check service collectd service is running"
           command: systemctl is-active --quiet collectd
-          when: (collectd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - collectd_enabled.rc == 0
           tags: validation
         - name: Stop and disable collectd service
-          when: (collectd_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - collectd_enabled.rc == 0
           service: name=collectd.service state=stopped enabled=no
         - name: Set fact for removal of collectd package
           when: step|int == 2
@@ -138,4 +142,6 @@ outputs:
         - name: Remove collectd package if operator requests it
           yum: name=collectd state=removed
           ignore_errors: True
-          when: (remove_collectd_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_collectd_package|bool
diff --git a/docker/services/congress.yaml b/docker/services/congress.yaml
index 55033a5a80..c15e6f6af2 100644
--- a/docker/services/congress.yaml
+++ b/docker/services/congress.yaml
@@ -155,10 +155,14 @@ outputs:
           register: congress_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-congress-server is running"
           command: systemctl is-active --quiet openstack-congress-server
-          when: (congress_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - congress_enabled.rc == 0
           tags: validation
         - name: Stop and disable congress_api service
-          when: (congress_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - congress_enabled.rc == 0
           service: name=openstack-congress-server state=stopped enabled=no
         - name: Set fact for removal of openstack-congress package
           when: step|int == 2
@@ -167,4 +171,6 @@ outputs:
         - name: Remove openstack-congress package if operator requests it
           yum: name=openstack-congress state=removed
           ignore_errors: True
-          when: (remove_congress_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_congress_package|bool
diff --git a/docker/services/database/mongodb.yaml b/docker/services/database/mongodb.yaml
index 23b9f45e3b..b882e7b348 100644
--- a/docker/services/database/mongodb.yaml
+++ b/docker/services/database/mongodb.yaml
@@ -172,8 +172,12 @@ outputs:
           register: mongod_enabled
         - name: "PreUpgrade step0,validation: Check if mongod is running"
           command: systemctl is-active --quiet mongod
-          when: (mongod_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mongod_enabled.rc == 0
           tags: validation
         - name: Stop and disable mongodb service
-          when: (mongod_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - mongod_enabled.rc == 0
           service: name=mongod state=stopped enabled=no
diff --git a/docker/services/database/mysql.yaml b/docker/services/database/mysql.yaml
index 67c4c358a1..87c3936e0f 100644
--- a/docker/services/database/mysql.yaml
+++ b/docker/services/database/mysql.yaml
@@ -241,8 +241,12 @@ outputs:
           register: mariadb_enabled
         - name: "PreUpgrade step0,validation: Check if mysql service is running"
           command: systemctl is-active --quiet mariadb
-          when: (mariadb_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mariadb_enabled.rc == 0
           tags: validation
         - name: Stop and disable mysql service
-          when: (mariadb_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - mariadb_enabled.rc == 0
           service: name=mariadb state=stopped enabled=no
diff --git a/docker/services/database/redis.yaml b/docker/services/database/redis.yaml
index d90990ac38..d57d67e301 100644
--- a/docker/services/database/redis.yaml
+++ b/docker/services/database/redis.yaml
@@ -131,8 +131,12 @@ outputs:
           register: redis_enabled
         - name: "PreUpgrade step0,validation: Check if redis is running"
           command: systemctl is-active --quiet redis
-          when: (redis_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - redis_enabled.rc == 0
           tags: validation
         - name: Stop and disable redis service
-          when: (redis_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - redis_enabled.rc == 0
           service: name=redis state=stopped enabled=no
diff --git a/docker/services/ec2-api.yaml b/docker/services/ec2-api.yaml
index 30c8c6a9b3..9c2551a3d8 100644
--- a/docker/services/ec2-api.yaml
+++ b/docker/services/ec2-api.yaml
@@ -217,17 +217,25 @@ outputs:
           register: ec2_api_metadata_enabled
         - name: "PreUpgrade step0,validation: Check if openstack-ec2-api is running"
           command: systemctl is-active --quiet openstack-ec2-api
-          when: (ec2_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ec2_api_enabled.rc == 0
           tags: validation
         - name: "PreUpgrade step0,validation: Check if openstack-ec2-metadata-api is running"
           command: systemctl is-active --quiet openstack-ec2-api-metadata
-          when: (ec2_api_metadata_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ec2_api_metadata_enabled.rc == 0
           tags: validation
         - name: Stop and disable EC2-API service
-          when: (ec2_api_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ec2_api_enabled.rc == 0
           service: name=openstack-ec2-api state=stopped enabled=no
         - name: Stop and disable EC2-API-METADATA service
-          when: (ec2_api_metadata_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ec2_api_metadata_enabled.rc == 0
           service: name=openstack-ec2-api-metadata state=stopped enabled=no
       metadata_settings:
         get_attr: [Ec2ApiPuppetBase, role_data, metadata_settings]
diff --git a/docker/services/etcd.yaml b/docker/services/etcd.yaml
index 8c2211f776..1695c424c3 100644
--- a/docker/services/etcd.yaml
+++ b/docker/services/etcd.yaml
@@ -122,8 +122,12 @@ outputs:
           register: etcd_enabled
         - name: "PreUpgrade step0,validation: Check if etcd is running"
           command: systemctl is-active --quiet etcd
-          when: (etcd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - etcd_enabled.rc == 0
           tags: validation
         - name: Stop and disable etcd service
-          when: (etcd_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - etcd_enabled.rc == 0
           service: name=etcd state=stopped enabled=no
diff --git a/docker/services/glance-api.yaml b/docker/services/glance-api.yaml
index bea9bdd047..bbae7f9e5e 100644
--- a/docker/services/glance-api.yaml
+++ b/docker/services/glance-api.yaml
@@ -241,9 +241,13 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-glance-api is running"
           command: systemctl is-active --quiet openstack-glance-api
           tags: validation
-          when: (glance_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - glance_api_enabled.rc == 0
         - name: Stop and disable glance_api service
-          when: (glance_api_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - glance_api_enabled.rc == 0
           service: name=openstack-glance-api state=stopped enabled=no
         - name: Set fact for removal of openstack-glance package
           when: step|int == 2
@@ -252,6 +256,8 @@ outputs:
         - name: Remove openstack-glance package if operator requests it
           yum: name=openstack-glance state=removed
           ignore_errors: True
-          when: (remove_glance_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_glance_package|bool
       metadata_settings:
         get_attr: [GlanceApiPuppetBase, role_data, metadata_settings]
diff --git a/docker/services/gnocchi-api.yaml b/docker/services/gnocchi-api.yaml
index 5659def883..0ef6be9828 100644
--- a/docker/services/gnocchi-api.yaml
+++ b/docker/services/gnocchi-api.yaml
@@ -202,11 +202,17 @@ outputs:
           register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-api is running"
           command: systemctl is-active --quiet openstack-gnocchi-api
-          when: (gnocchi_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - gnocchi_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
           tags: validation
         - name: Stop and disable gnocchi_api service
           service: name=openstack-gnocchi-api state=stopped enabled=no
-          when: (gnocchi_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - gnocchi_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
         - name: Check if httpd service is running
           command: systemctl is-active --quiet httpd
           tags: common
@@ -215,9 +221,15 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if gnocchi_api_wsgi is running"
           shell: systemctl status 'httpd' | grep -q gnocchi
           tags: validation
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop and disable httpd service
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
           service: name=httpd state=stopped enabled=no
       metadata_settings:
         get_attr: [GnocchiApiPuppetBase, role_data, metadata_settings]
diff --git a/docker/services/gnocchi-metricd.yaml b/docker/services/gnocchi-metricd.yaml
index 085471a9a6..6d5be4677a 100644
--- a/docker/services/gnocchi-metricd.yaml
+++ b/docker/services/gnocchi-metricd.yaml
@@ -141,8 +141,12 @@ outputs:
           register: gnocchi_metricd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-metricd is running"
           command: systemctl is-active --quiet openstack-gnocchi-metricd
-          when: (gnocchi_metricd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - gnocchi_metricd_enabled.rc == 0
           tags: validation
         - name: Stop and disable openstack-gnocchi-metricd service
-          when: (gnocchi_metricd_enabled.rc == 0)  and (step|int == 2)
+          when:
+            - step|int == 2
+            - gnocchi_metricd_enabled.rc == 0
           service: name=openstack-gnocchi-metricd.service state=stopped enabled=no
diff --git a/docker/services/gnocchi-statsd.yaml b/docker/services/gnocchi-statsd.yaml
index 19d30953ef..1216f92f58 100644
--- a/docker/services/gnocchi-statsd.yaml
+++ b/docker/services/gnocchi-statsd.yaml
@@ -141,8 +141,12 @@ outputs:
           register: gnocchi_statsd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-statsd is running"
           command: systemctl is-active --quiet openstack-gnocchi-statsd
-          when: (gnocchi_statsd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - gnocchi_statsd_enabled.rc == 0
           tags: validation
         - name: Stop and disable openstack-gnocchi-statsd service
-          when: (gnocchi_statsd_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - gnocchi_statsd_enabled.rc == 0
           service: name=openstack-gnocchi-statsd.service state=stopped enabled=no
diff --git a/docker/services/heat-api-cfn.yaml b/docker/services/heat-api-cfn.yaml
index d98cc372f6..3c87277e37 100644
--- a/docker/services/heat-api-cfn.yaml
+++ b/docker/services/heat-api-cfn.yaml
@@ -142,11 +142,17 @@ outputs:
           register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-api-cfn is running"
           command: systemctl is-active --quiet openstack-heat-api-cfn
-          when: (heat_api_cfn_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - heat_api_cfn_enabled.rc == 0
+            - httpd_enabled.rc != 0
           tags: validation
         - name: Stop and disable heat_api_cfn service (pre-upgrade not under httpd)
           service: name=openstack-heat-api-cfn state=stopped enabled=no
-          when: (heat_api_cfn_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - heat_api_cfn_enabled.rc == 0
+            - httpd_enabled.rc != 0
         - name: Check if httpd service is running
           command: systemctl is-active --quiet httpd
           tags: common
@@ -155,9 +161,15 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if heat_api_cfn_wsgi is running"
           tags: validation
           shell: systemctl status 'httpd' | grep -q heat_api_cfn_wsgi
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop heat_api_cfn service (running under httpd)
           service: name=httpd state=stopped
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
       metadata_settings:
         get_attr: [HeatBase, role_data, metadata_settings]
diff --git a/docker/services/heat-api.yaml b/docker/services/heat-api.yaml
index fae16ef1dc..1ebd010d6b 100644
--- a/docker/services/heat-api.yaml
+++ b/docker/services/heat-api.yaml
@@ -180,11 +180,17 @@ outputs:
           register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-api is running"
           command: systemctl is-active --quiet openstack-heat-api
-          when: (heat_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - heat_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
           tags: validation
         - name: Stop and disable heat_api service (pre-upgrade not under httpd)
           service: name=openstack-heat-api state=stopped enabled=no
-          when: (heat_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - heat_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
         - name: Check if httpd is running
           tags: common
           command: systemctl is-active --quiet httpd
@@ -193,10 +199,16 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if heat_api_wsgi is running"
           shell: systemctl status 'httpd' | grep -q heat_api_wsgi
           tags: validation
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop heat_api service (running under httpd)
           service: name=httpd state=stopped
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: remove old heat cron jobs
           when: step|int == 2
           file:
diff --git a/docker/services/heat-engine.yaml b/docker/services/heat-engine.yaml
index 1f3d4c5202..578fd59265 100644
--- a/docker/services/heat-engine.yaml
+++ b/docker/services/heat-engine.yaml
@@ -141,8 +141,12 @@ outputs:
           register: heat_engine_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-engine is running"
           command: systemctl is-active --quiet openstack-heat-engine
-          when: (heat_engine_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - heat_engine_enabled.rc == 0
           tags: validation
         - name: Stop and disable heat_engine service
-          when: (heat_engine_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - heat_engine_enabled.rc == 0
           service: name=openstack-heat-engine state=stopped enabled=no
diff --git a/docker/services/horizon.yaml b/docker/services/horizon.yaml
index b6f026d19d..907e4d4095 100644
--- a/docker/services/horizon.yaml
+++ b/docker/services/horizon.yaml
@@ -194,10 +194,14 @@ outputs:
           register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check if horizon is running"
           shell: systemctl is-active --quiet httpd
-          when: (httpd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
           tags: validation
         - name: Stop and disable horizon service (running under httpd)
-          when: (httpd_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
           service: name=httpd state=stopped enabled=no
       metadata_settings:
         get_attr: [HorizonBase, role_data, metadata_settings]
diff --git a/docker/services/ironic-api.yaml b/docker/services/ironic-api.yaml
index 733e0e2aa1..40f5496fc1 100644
--- a/docker/services/ironic-api.yaml
+++ b/docker/services/ironic-api.yaml
@@ -163,10 +163,16 @@ outputs:
           register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ironic-api is running"
           command: systemctl is-active --quiet openstack-ironic-api
-          when: (ironic_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ironic_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
           tags: validation
         - name: Stop and disable ironic_api service
-          when: (ironic_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ironic_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
           service: name=openstack-ironic-api state=stopped enabled=no
         - name: Check if httpd service is running
           command: systemctl is-active --quiet httpd
@@ -176,7 +182,13 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if ironic_api_wsgi is running"
           shell: systemctl status 'httpd' | grep -q ironic
           tags: validation
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop ironic_api service (running under httpd)
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
           service: name=httpd state=stopped enabled=no
diff --git a/docker/services/ironic-conductor.yaml b/docker/services/ironic-conductor.yaml
index 456ea73fde..e5f82c788b 100644
--- a/docker/services/ironic-conductor.yaml
+++ b/docker/services/ironic-conductor.yaml
@@ -175,7 +175,11 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-ironic-conductor is running"
           command: systemctl is-active --quiet openstack-ironic-conductor
           tags: validation
-          when: (ironic_conductor_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ironic_conductor_enabled.rc == 0
         - name: Stop and disable ironic_conductor service
-          when: (ironic_conductor_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ironic_conductor_enabled.rc == 0
           service: name=openstack-ironic-conductor state=stopped enabled=no
diff --git a/docker/services/iscsid.yaml b/docker/services/iscsid.yaml
index 41c439a457..760035d9b4 100644
--- a/docker/services/iscsid.yaml
+++ b/docker/services/iscsid.yaml
@@ -117,10 +117,14 @@ outputs:
           register: iscsid_enabled
         - name: "PreUpgrade step0,validation: Check if iscsid is running"
           command: systemctl is-active --quiet iscsid
-          when: (iscsid_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - iscsid_enabled.rc == 0
           tags: validation
         - name: Stop and disable iscsid service
-          when: (iscsid_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - iscsid_enabled.rc == 0
           service: name=iscsid state=stopped enabled=no
         - name: Check if iscsid.socket service is deployed
           tags: common
@@ -129,8 +133,12 @@ outputs:
           register: iscsid_socket_enabled
         - name: "PreUpgrade step0,validation: Check if iscsid.socket is running"
           command: systemctl is-active --quiet iscsid.socket
-          when: (iscsid_socket_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - iscsid_socket_enabled.rc == 0
           tags: validation
         - name: Stop and disable iscsid.socket service
-          when: (iscsid_socket_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - iscsid_socket_enabled.rc == 0
           service: name=iscsid.socket state=stopped enabled=no
diff --git a/docker/services/keepalived.yaml b/docker/services/keepalived.yaml
index 2a8a22dc4d..5654b0b81f 100644
--- a/docker/services/keepalived.yaml
+++ b/docker/services/keepalived.yaml
@@ -121,8 +121,12 @@ outputs:
           register: keepalived_enabled
         - name: "PreUpgrade step0,validation: Check service keepalived is running"
           command: systemctl is-active --quiet keepalived
-          when: (keepalived_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - keepalived_enabled.rc == 0
           tags: validation
         - name: Stop and disable keepalived service
-          when: (keepalived_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - keepalived_enabled.rc == 0
           service: name=keepalived state=stopped enabled=no
diff --git a/docker/services/keystone.yaml b/docker/services/keystone.yaml
index b4210e4d4c..0a417ffa67 100644
--- a/docker/services/keystone.yaml
+++ b/docker/services/keystone.yaml
@@ -210,9 +210,15 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if keystone_wsgi is running under httpd"
           shell: systemctl status 'httpd' | grep -q keystone
           tags: validation
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop and disable keystone service (running under httpd)
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
           service: name=httpd state=stopped enabled=no
         - name: remove old keystone cron jobs
           when: step|int == 2
diff --git a/docker/services/manila-api.yaml b/docker/services/manila-api.yaml
index d04ae8a7cf..66348b26ae 100644
--- a/docker/services/manila-api.yaml
+++ b/docker/services/manila-api.yaml
@@ -145,8 +145,12 @@ outputs:
           register: manila_api_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-manila-api is running"
           command: systemctl is-active --quiet openstack-manila-api
-          when: (manila_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - manila_api_enabled.rc == 0
           tags: validation
         - name: Stop and disable manila_api service
-          when: (manila_api_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - manila_api_enabled.rc == 0
           service: name=openstack-manila-api state=stopped enabled=no
diff --git a/docker/services/manila-scheduler.yaml b/docker/services/manila-scheduler.yaml
index 84d2dffa0b..fd0c28c15e 100644
--- a/docker/services/manila-scheduler.yaml
+++ b/docker/services/manila-scheduler.yaml
@@ -121,8 +121,12 @@ outputs:
           register: manila_scheduler_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-manila-scheduler is running"
           command: systemctl is-active --quiet openstack-manila-scheduler
-          when: (manila_scheduler_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - manila_scheduler_enabled.rc == 0
           tags: validation
         - name: Stop and disable manila_scheduler service
-          when: (manila_scheduler_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - manila_scheduler_enabled.rc == 0
           service: name=openstack-manila-scheduler state=stopped enabled=no
diff --git a/docker/services/manila-share.yaml b/docker/services/manila-share.yaml
index 3fe2f29a44..7991bd1c16 100644
--- a/docker/services/manila-share.yaml
+++ b/docker/services/manila-share.yaml
@@ -143,8 +143,12 @@ outputs:
           register: manila_share_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-manila-share is running"
           command: systemctl is-active --quiet openstack-manila-share
-          when: (manila_share_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - manila_share_enabled.rc == 0
           tags: validation
         - name: Stop and disable manila_share service
-          when: (manila_share_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - manila_share_enabled.rc == 0
           service: name=openstack-manila-share state=stopped enabled=no
diff --git a/docker/services/memcached.yaml b/docker/services/memcached.yaml
index dee84eb8ee..1a69a27040 100644
--- a/docker/services/memcached.yaml
+++ b/docker/services/memcached.yaml
@@ -122,8 +122,12 @@ outputs:
           register: memcached_enabled
         - name: "PreUpgrade step0,validation: Check service memcached is running"
           command: systemctl is-active --quiet memcached
-          when: (memcached_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - memcached_enabled.rc == 0
           tags: validation
         - name: Stop and disable memcached service
-          when: (memcached_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - memcached_enabled.rc == 0
           service: name=memcached state=stopped enabled=no
diff --git a/docker/services/mistral-api.yaml b/docker/services/mistral-api.yaml
index 5897b697c5..c207b8ba20 100644
--- a/docker/services/mistral-api.yaml
+++ b/docker/services/mistral-api.yaml
@@ -205,10 +205,16 @@ outputs:
           register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check if openstack-mistral-api is running"
           command: systemctl is-active --quiet openstack-mistral-api
-          when: (mistral_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mistral_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
           tags: validation
         - name: Stop and disable mistral_api service (pre-upgrade not under httpd)
-          when: (mistral_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - mistral_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
           service: name=openstack-mistral-api state=stopped enabled=no
         - name: Check if httpd service is running
           command: systemctl is-active --quiet httpd
@@ -218,7 +224,13 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if mistral_api_wsgi is running"
           shell: systemctl status 'httpd' | grep -q mistral
           tags: validation
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop mistral_api service (running under httpd)
           service: name=httpd state=stopped enabled=no
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
diff --git a/docker/services/mistral-engine.yaml b/docker/services/mistral-engine.yaml
index 8a06024a6e..afd7c419ed 100644
--- a/docker/services/mistral-engine.yaml
+++ b/docker/services/mistral-engine.yaml
@@ -128,8 +128,12 @@ outputs:
           register: mistral_engine_enabled
         - name: "PreUpgrade step0,validation: Check if openstack-mistral-engine is running"
           command: systemctl is-active --quiet openstack-mistral-engine
-          when: (mistral_engine_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mistral_engine_enabled.rc == 0
           tags: validation
         - name: Stop and disable mistral_engine service
-          when: (mistral_engine_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - mistral_engine_enabled.rc == 0
           service: name=openstack-mistral-engine state=stopped enabled=no
diff --git a/docker/services/mistral-event-engine.yaml b/docker/services/mistral-event-engine.yaml
index 71c2163e4f..1a52b8c5a3 100644
--- a/docker/services/mistral-event-engine.yaml
+++ b/docker/services/mistral-event-engine.yaml
@@ -126,8 +126,12 @@ outputs:
           register: mistral_event_engine_enabled
         - name: "PreUpgrade step0,validation: Check if openstack-mistral-event-engine is running"
           command: systemctl is-active --quiet openstack-mistral-event-engine
-          when: (mistral_event_engine_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mistral_event_engine_enabled.rc == 0
           tags: validation
         - name: Stop and disable mistral_event_engine service
-          when: (mistral_event_engine_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - mistral_event_engine_enabled.rc == 0
           service: name=openstack-mistral-event-engine state=stopped enabled=no
diff --git a/docker/services/mistral-executor.yaml b/docker/services/mistral-executor.yaml
index 0499e08320..85acd48de5 100644
--- a/docker/services/mistral-executor.yaml
+++ b/docker/services/mistral-executor.yaml
@@ -132,8 +132,12 @@ outputs:
           register: mistral_executor_enabled
         - name: "PreUpgrade step0,validation: Check if openstack-mistral-executor is running"
           command: systemctl is-active --quiet openstack-mistral-executor
-          when: (mistral_executor_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mistral_executor_enabled.rc == 0
           tags: validation
         - name: Stop and disable mistral_executor service
-          when: (mistral_executor_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - mistral_executor_enabled.rc == 0
           service: name=openstack-mistral-executor state=stopped enabled=no
diff --git a/docker/services/multipathd.yaml b/docker/services/multipathd.yaml
index bbbd0e991c..23d1ef2145 100644
--- a/docker/services/multipathd.yaml
+++ b/docker/services/multipathd.yaml
@@ -93,8 +93,12 @@ outputs:
           register: multipathd_enabled
         - name: "PreUpgrade step0,validation: Check service multipathd is running"
           command: systemctl is-active --quiet multipathd
-          when: (multipathd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - multipathd_enabled.rc == 0
           tags: validation
         - name: Stop and disable multipathd service
-          when: (multipathd_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - multipathd_enabled.rc == 0
           service: name=multipathd state=stopped enabled=no
diff --git a/docker/services/neutron-api.yaml b/docker/services/neutron-api.yaml
index 41f44badf7..9507e27d53 100644
--- a/docker/services/neutron-api.yaml
+++ b/docker/services/neutron-api.yaml
@@ -188,10 +188,14 @@ outputs:
           register: neutron_server_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-server is running"
           command: systemctl is-active --quiet neutron-server
-          when: (neutron_server_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_server_enabled.rc == 0
           tags: validation
         - name: Stop and disable neutron_api service
-          when: (neutron_server_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - neutron_server_enabled.rc == 0
           service: name=neutron-server state=stopped enabled=no
         - name: Set fact for removal of openstack-neutron package
           when: step|int == 2
@@ -200,6 +204,8 @@ outputs:
         - name: Remove openstack-neutron package if operator requests it
           yum: name=openstack-neutron state=removed
           ignore_errors: True
-          when: (remove_neutron_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_neutron_package|bool
       metadata_settings:
         get_attr: [NeutronBase, role_data, metadata_settings]
diff --git a/docker/services/neutron-dhcp.yaml b/docker/services/neutron-dhcp.yaml
index 2e91c9a04e..790ae5ac8b 100644
--- a/docker/services/neutron-dhcp.yaml
+++ b/docker/services/neutron-dhcp.yaml
@@ -127,8 +127,12 @@ outputs:
           register: neutron_dhcp_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-dhcp-agent is running"
           command: systemctl is-active --quiet neutron-dhcp-agent
-          when: (neutron_dhcp_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_dhcp_agent_enabled.rc == 0
           tags: validation
         - name: Stop and disable neutron_dhcp service
-          when: (neutron_dhcp_agent_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - neutron_dhcp_agent_enabled.rc == 0
           service: name=neutron-dhcp-agent state=stopped enabled=no
diff --git a/docker/services/neutron-l3.yaml b/docker/services/neutron-l3.yaml
index 1470b8607c..393bfa972e 100644
--- a/docker/services/neutron-l3.yaml
+++ b/docker/services/neutron-l3.yaml
@@ -125,8 +125,12 @@ outputs:
           register: neutron_l3_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-l3-agent is running"
           command: systemctl is-active --quiet neutron-l3-agent
-          when: (neutron_l3_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_l3_agent_enabled.rc == 0
           tags: validation
         - name: Stop and disable neutron_l3 service
-          when: (neutron_l3_agent_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - neutron_l3_agent_enabled.rc == 0
           service: name=neutron-l3-agent state=stopped enabled=no
diff --git a/docker/services/neutron-metadata.yaml b/docker/services/neutron-metadata.yaml
index 84329424f8..3ae11f3b44 100644
--- a/docker/services/neutron-metadata.yaml
+++ b/docker/services/neutron-metadata.yaml
@@ -124,8 +124,12 @@ outputs:
           register: neutron_metadata_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-metadata-agent is running"
           command: systemctl is-active --quiet neutron-metadata-agent
-          when: (neutron_metadata_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_metadata_agent_enabled.rc == 0
           tags: validation
         - name: Stop and disable neutron_metadata service
-          when: (neutron_metadata_agent_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - neutron_metadata_agent_enabled.rc == 0
           service: name=neutron-metadata-agent state=stopped enabled=no
diff --git a/docker/services/neutron-sriov-agent.yaml b/docker/services/neutron-sriov-agent.yaml
index 2acdf81eff..5b6c69e4c1 100644
--- a/docker/services/neutron-sriov-agent.yaml
+++ b/docker/services/neutron-sriov-agent.yaml
@@ -112,8 +112,12 @@ outputs:
           register: neutron_sriov_nic_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-sriov-nic-agent is running"
           command: systemctl is-active --quiet neutron-sriov-nic-agent
-          when: (neutron_sriov_nic_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_sriov_nic_agent_enabled.rc == 0
           tags: validation
         - name: Stop and disable neutron_sriov_agent service
-          when: (neutron_sriov_nic_agent_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - neutron_sriov_nic_agent_enabled.rc == 0
           service: name=neutron-sriov-nic-agent state=stopped enabled=no
diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml
index fe4bcacfbc..ab4840c538 100644
--- a/docker/services/nova-api.yaml
+++ b/docker/services/nova-api.yaml
@@ -319,9 +319,15 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-nova-api is running"
           command: systemctl is-active --quiet openstack-nova-api
           tags: validation
-          when: (nova_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
         - name: Stop and disable nova_api service
-          when: (nova_api_enabled.rc == 0) and (httpd_enabled.rc != 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_api_enabled.rc == 0
+            - httpd_enabled.rc != 0
           service: name=openstack-nova-api state=stopped enabled=no
         - name: Check if httpd service is running
           command: systemctl is-active --quiet httpd
@@ -331,9 +337,15 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if nova_wsgi is running"
           tags: validation
           shell: systemctl status 'httpd' | grep -q 'nova'
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop nova_api service (running under httpd)
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
           service: name=httpd state=stopped
         - name: Set fact for removal of openstack-nova-api package
           when: step|int == 2
@@ -342,7 +354,9 @@ outputs:
         - name: Remove openstack-nova-api package if operator requests it
           yum: name=openstack-nova-api state=removed
           ignore_errors: True
-          when: (remove_nova_api_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_nova_api_package|bool
         - name: remove old nova cron jobs
           when: step|int == 2
           file:
diff --git a/docker/services/nova-compute.yaml b/docker/services/nova-compute.yaml
index c2a2b97f35..e5f8e951ca 100644
--- a/docker/services/nova-compute.yaml
+++ b/docker/services/nova-compute.yaml
@@ -203,9 +203,13 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-nova-compute is running"
           command: systemctl is-active --quiet openstack-nova-compute
           tags: validation
-          when: (nova_compute_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_compute_enabled.rc == 0
         - name: Stop and disable nova-compute service
-          when: (nova_compute_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_compute_enabled.rc == 0
           service: name=openstack-nova-compute state=stopped enabled=no
         - name: Set fact for removal of openstack-nova-compute package
           when: step|int == 2
@@ -214,4 +218,6 @@ outputs:
         - name: Remove openstack-nova-compute package if operator requests it
           yum: name=openstack-nova-compute state=removed
           ignore_errors: True
-          when: (remove_nova_compute_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_nova_compute_package|bool
diff --git a/docker/services/nova-conductor.yaml b/docker/services/nova-conductor.yaml
index 40a39331e3..7a330771ac 100644
--- a/docker/services/nova-conductor.yaml
+++ b/docker/services/nova-conductor.yaml
@@ -143,9 +143,13 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-nova-conductor is running"
           command: systemctl is-active --quiet openstack-nova-conductor
           tags: validation
-          when: (nova_conductor_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_conductor_enabled.rc == 0
         - name: Stop and disable nova_conductor service
-          when: (nova_conductor_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_conductor_enabled.rc == 0
           service: name=openstack-nova-conductor state=stopped enabled=no
         - name: Set fact for removal of openstack-nova-conductor package
           when: step|int == 2
@@ -154,4 +158,6 @@ outputs:
         - name: Remove openstack-nova-conductor package if operator requests it
           yum: name=openstack-nova-conductor state=removed
           ignore_errors: True
-          when: (remove_nova_conductor_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_nova_conductor_package|bool
diff --git a/docker/services/nova-consoleauth.yaml b/docker/services/nova-consoleauth.yaml
index d654bb571c..05e2314514 100644
--- a/docker/services/nova-consoleauth.yaml
+++ b/docker/services/nova-consoleauth.yaml
@@ -131,9 +131,13 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-nova-consoleauth is running"
           command: systemctl is-active --quiet openstack-nova-consoleauth
           tags: validation
-          when: (nova_consoleauth_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_consoleauth_enabled.rc == 0
         - name: Stop and disable nova_consoleauth service
-          when: (nova_consoleauth_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_consoleauth_enabled.rc == 0
           service: name=openstack-nova-consoleauth state=stopped enabled=no
         - name: Set fact for removal of openstack-nova-console package
           when: step|int == 2
@@ -142,4 +146,6 @@ outputs:
         - name: Remove openstack-nova-console package if operator requests it
           yum: name=openstack-nova-console state=removed
           ignore_errors: True
-          when: (remove_nova_console_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_nova_console_package|bool
diff --git a/docker/services/nova-ironic.yaml b/docker/services/nova-ironic.yaml
index 996bacb4eb..ff62a45cd9 100644
--- a/docker/services/nova-ironic.yaml
+++ b/docker/services/nova-ironic.yaml
@@ -138,7 +138,11 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-nova-compute is running"
           command: systemctl is-active --quiet openstack-nova-compute
           tags: validation
-          when: (nova_ironic_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_ironic_enabled.rc == 0
         - name: Stop and disable nova-compute service
-          when: (nova_ironic_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_ironic_enabled.rc == 0
           service: name=openstack-nova-compute state=stopped enabled=no
diff --git a/docker/services/nova-libvirt.yaml b/docker/services/nova-libvirt.yaml
index f0a29c6e33..014523033b 100644
--- a/docker/services/nova-libvirt.yaml
+++ b/docker/services/nova-libvirt.yaml
@@ -318,7 +318,11 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service libvirtd is running"
           command: systemctl is-active --quiet libvirtd
           tags: validation
-          when: (nova_libvirt_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_libvirt_enabled.rc == 0
         - name: Stop and disable libvirtd service
-          when: (nova_libvirt_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_libvirt_enabled.rc == 0
           service: name=libvirtd state=stopped enabled=no
diff --git a/docker/services/nova-metadata.yaml b/docker/services/nova-metadata.yaml
index b609196e6c..061e0e2820 100644
--- a/docker/services/nova-metadata.yaml
+++ b/docker/services/nova-metadata.yaml
@@ -125,7 +125,11 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-nova-api is running"
           command: systemctl is-active --quiet openstack-nova-api
           tags: validation
-          when: (nova_metadata_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_metadata_enabled.rc == 0
         - name: Stop and disable nova_api service
-          when: (nova_metadata_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_metadata_enabled.rc == 0
           service: name=openstack-nova-api state=stopped enabled=no
diff --git a/docker/services/nova-placement.yaml b/docker/services/nova-placement.yaml
index 80bee561e6..9d8a3c9ea7 100644
--- a/docker/services/nova-placement.yaml
+++ b/docker/services/nova-placement.yaml
@@ -151,9 +151,15 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if placement_wsgi is running"
           shell: systemctl status 'httpd' | grep -q placement_wsgi
           tags: validation
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop and disable nova_placement service (running under httpd)
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
           service: name=httpd state=stopped enabled=no
         - name: Set fact for removal of httpd package
           when: step|int == 2
@@ -162,5 +168,7 @@ outputs:
         - name: Remove httpd package if operator requests it
           yum: name=httpd state=removed
           ignore_errors: True
-          when: (remove_httpd_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_httpd_package|bool
 
diff --git a/docker/services/nova-scheduler.yaml b/docker/services/nova-scheduler.yaml
index 13b4636662..135a208ed5 100644
--- a/docker/services/nova-scheduler.yaml
+++ b/docker/services/nova-scheduler.yaml
@@ -132,9 +132,13 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-nova-scheduler is running"
           command: systemctl is-active --quiet openstack-nova-scheduler
           tags: validation
-          when: (nova_scheduler_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_scheduler_enabled.rc == 0
         - name: Stop and disable nova_scheduler service
-          when: (nova_scheduler_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_scheduler_enabled.rc == 0
           service: name=openstack-nova-scheduler state=stopped enabled=no
         - name: Set fact for removal of openstack-nova-scheduler package
           when: step|int == 2
@@ -143,4 +147,6 @@ outputs:
         - name: Remove openstack-nova-scheduler package if operator requests it
           yum: name=openstack-nova-scheduler state=removed
           ignore_errors: True
-          when: (remove_nova_scheduler_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_nova_scheduler_package|bool
diff --git a/docker/services/nova-vnc-proxy.yaml b/docker/services/nova-vnc-proxy.yaml
index d7be00a630..fe1aa46fe6 100644
--- a/docker/services/nova-vnc-proxy.yaml
+++ b/docker/services/nova-vnc-proxy.yaml
@@ -131,9 +131,13 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-nova-novncproxy is running"
           command: systemctl is-active --quiet openstack-nova-novncproxy
           tags: validation
-          when: (nova_vncproxy_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - nova_vncproxy_enabled.rc == 0
         - name: Stop and disable nova_vnc_proxy service
-          when: (nova_vncproxy_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - nova_vncproxy_enabled.rc == 0
           service: name=openstack-nova-novncproxy state=stopped enabled=no
         - name: Set fact for removal of openstack-nova-novncproxy package
           when: step|int == 2
@@ -142,4 +146,6 @@ outputs:
         - name: Remove openstack-nova-novncproxy package if operator requests it
           yum: name=openstack-nova-novncproxy state=removed
           ignore_errors: True
-          when: (remove_nova_novncproxy_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_nova_novncproxy_package|bool
diff --git a/docker/services/octavia-health-manager.yaml b/docker/services/octavia-health-manager.yaml
index 0a4d8932e3..9f66aeec7b 100644
--- a/docker/services/octavia-health-manager.yaml
+++ b/docker/services/octavia-health-manager.yaml
@@ -135,4 +135,6 @@ outputs:
         - name: Remove openstack-octavia-health-manager package if operator requests it
           yum: name=openstack-octavia-health-manager state=removed
           ignore_errors: True
-          when: (remove_octavia_health_manager_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_octavia_health_manager_package|bool
diff --git a/docker/services/opendaylight-api.yaml b/docker/services/opendaylight-api.yaml
index 0ccf46e8f0..6175db9642 100644
--- a/docker/services/opendaylight-api.yaml
+++ b/docker/services/opendaylight-api.yaml
@@ -157,10 +157,14 @@ outputs:
           register: opendaylight_enabled
         - name: "PreUpgrade step0,validation: Check service opendaylight is running"
           command: systemctl is-active --quiet opendaylight
-          when: (opendaylight_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - opendaylight_enabled.rc == 0
           tags: validation
         - name: Stop and disable opendaylight_api service
-          when: (opendaylight_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - opendaylight_enabled.rc == 0
           service: name=opendaylight state=stopped enabled=no
         # Containarised deployment upgrade steps
         - name: remove journal and snapshots
diff --git a/docker/services/ovn-controller.yaml b/docker/services/ovn-controller.yaml
index 189d78c169..5c86c28970 100644
--- a/docker/services/ovn-controller.yaml
+++ b/docker/services/ovn-controller.yaml
@@ -135,8 +135,12 @@ outputs:
           register: ovn_controller_enabled
         - name: "PreUpgrade step0,validation: Check service ovn_controller is running"
           command: systemctl is-active --quiet ovn-controller
-          when: (ovn_controller_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ovn_controller_enabled.rc == 0
           tags: validation
         - name: Stop and disable ovn-controller service
-          when: (ovn_controller_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ovn_controller_enabled.rc == 0
           service: name=ovn-controller state=stopped enabled=no
diff --git a/docker/services/ovn-dbs.yaml b/docker/services/ovn-dbs.yaml
index 44a32ec662..d9eacb3dd2 100644
--- a/docker/services/ovn-dbs.yaml
+++ b/docker/services/ovn-dbs.yaml
@@ -212,8 +212,12 @@ outputs:
           register: ovn_northd_enabled
         - name: "PreUpgrade step0,validation: Check service ovn_northd is running"
           command: systemctl is-active --quiet ovn-northd
-          when: (ovn_northd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ovn_northd_enabled.rc == 0
           tags: validation
         - name: Stop and disable ovn-northd service
-          when: (ovn_northd_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - ovn_northd_enabled.rc == 0
           service: name=ovn-northd state=stopped enabled=no
diff --git a/docker/services/ovn-metadata.yaml b/docker/services/ovn-metadata.yaml
index b1f57c48a3..7dd4aa6dd9 100644
--- a/docker/services/ovn-metadata.yaml
+++ b/docker/services/ovn-metadata.yaml
@@ -146,8 +146,12 @@ outputs:
           register: networking_ovn_metadata_agent_enabled
         - name: "PreUpgrade step0,validation: Check service networking-ovn-metadata-agent is running"
           command: systemctl is-active --quiet networking-ovn-metadata-agent
-          when: (networking_ovn_metadata_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - networking_ovn_metadata_agent_enabled.rc == 0
           tags: validation
         - name: Stop and disable networking_ovn_metadata service
-          when: (networking_ovn_metadata_agent_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - networking_ovn_metadata_agent_enabled.rc == 0
           service: name=networking-ovn-metadata-agent state=stopped enabled=no
diff --git a/docker/services/pacemaker/cinder-backup.yaml b/docker/services/pacemaker/cinder-backup.yaml
index 9ed09d9dba..4cafcf0d2b 100644
--- a/docker/services/pacemaker/cinder-backup.yaml
+++ b/docker/services/pacemaker/cinder-backup.yaml
@@ -213,7 +213,9 @@ outputs:
         - name: set is_bootstrap_node fact
           tags: common
           set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
-        - when: (is_bootstrap_node) and (step|int == 2)
+        - when:
+            - step|int == 2
+            - is_bootstrap_node|bool
           block:
             - name: Disable the openstack-cinder-backup cluster resource
               pacemaker_resource:
diff --git a/docker/services/pacemaker/cinder-volume.yaml b/docker/services/pacemaker/cinder-volume.yaml
index 3fcb3b1388..4a6ddddfeb 100644
--- a/docker/services/pacemaker/cinder-volume.yaml
+++ b/docker/services/pacemaker/cinder-volume.yaml
@@ -238,7 +238,9 @@ outputs:
         - name: set is_bootstrap_node fact
           tags: common
           set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
-        - when: (is_bootstrap_node) and (step|int == 2)
+        - when:
+            - step|int == 2
+            - is_bootstrap_node|bool
           block:
             - name: Disable the openstack-cinder-volume cluster resource
               pacemaker_resource:
diff --git a/docker/services/pacemaker/database/mysql.yaml b/docker/services/pacemaker/database/mysql.yaml
index 043ed97d00..63a49878f8 100644
--- a/docker/services/pacemaker/database/mysql.yaml
+++ b/docker/services/pacemaker/database/mysql.yaml
@@ -282,7 +282,10 @@ outputs:
             check_mode: true
           ignore_errors: true
           register: galera_res
-        - when: (is_bootstrap_node) and (galera_res|succeeded) and (step|int == 2)
+        - when:
+            - step|int == 2
+            - is_bootstrap_node|bool
+            - galera_res|succeeded
           block:
             - name: Disable the galera cluster resource
               pacemaker_resource:
diff --git a/docker/services/pacemaker/database/redis.yaml b/docker/services/pacemaker/database/redis.yaml
index b2e86f5fe7..3dfcec482f 100644
--- a/docker/services/pacemaker/database/redis.yaml
+++ b/docker/services/pacemaker/database/redis.yaml
@@ -197,7 +197,10 @@ outputs:
             check_mode: true
           ignore_errors: true
           register: redis_res
-        - when: (is_bootstrap_node) and (redis_res|succeeded) and (step|int == 2)
+        - when:
+            - step|int == 2
+            - is_bootstrap_node|bool
+            - redis_res|succeeded
           block:
             - name: Disable the redis cluster resource
               pacemaker_resource:
diff --git a/docker/services/pacemaker/haproxy.yaml b/docker/services/pacemaker/haproxy.yaml
index 68f0ff4cfb..b0ca683cd0 100644
--- a/docker/services/pacemaker/haproxy.yaml
+++ b/docker/services/pacemaker/haproxy.yaml
@@ -234,7 +234,10 @@ outputs:
             check_mode: true
           ignore_errors: true
           register: haproxy_res
-        - when: (is_bootstrap_node) and (haproxy_res|succeeded) and (step|int == 2)
+        - when:
+            - step|int == 2
+            - is_bootstrap_node|bool
+            - haproxy_res|succeeded
           block:
             - name: Disable the haproxy cluster resource.
               pacemaker_resource:
diff --git a/docker/services/pacemaker/rabbitmq.yaml b/docker/services/pacemaker/rabbitmq.yaml
index 1cf45e9497..47b58ada6e 100644
--- a/docker/services/pacemaker/rabbitmq.yaml
+++ b/docker/services/pacemaker/rabbitmq.yaml
@@ -235,7 +235,10 @@ outputs:
             check_mode: true
           ignore_errors: true
           register: rabbitmq_res
-        - when: (is_bootstrap_node) and (rabbitmq_res|succeeded) and (step|int == 2)
+        - when:
+            - step|int == 2
+            - is_bootstrap_node|bool
+            - rabbitmq_res|succeeded
           block:
             - name: Disable the rabbitmq cluster resource.
               pacemaker_resource:
diff --git a/docker/services/rabbitmq.yaml b/docker/services/rabbitmq.yaml
index 8c98a89f06..af1bdfb7b1 100644
--- a/docker/services/rabbitmq.yaml
+++ b/docker/services/rabbitmq.yaml
@@ -232,10 +232,14 @@ outputs:
           register: rabbitmq_enabled
         - name: "PreUpgrade step0,validation: Check service rabbitmq server is running"
           command: systemctl is-active --quiet rabbitmq-server
-          when: (rabbitmq_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - rabbitmq_enabled.rc == 0
           tags: validation
         - name: Stop and disable rabbitmq service
-          when: (rabbitmq_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - rabbitmq_enabled.rc == 0
           service: name=rabbitmq-server state=stopped enabled=no
       update_tasks:
         # TODO: Are we sure we want to support this.  Rolling update
diff --git a/docker/services/sahara-api.yaml b/docker/services/sahara-api.yaml
index c8034ecc5b..9d43974f27 100644
--- a/docker/services/sahara-api.yaml
+++ b/docker/services/sahara-api.yaml
@@ -152,10 +152,14 @@ outputs:
           register: sahara_api_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-sahara-api is running"
           command: systemctl is-active --quiet openstack-sahara-api
-          when: (sahara_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - sahara_api_enabled.rc == 0
           tags: validation
         - name: Stop and disable sahara_api service
-          when: (sahara_api_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - sahara_api_enabled.rc == 0
           service: name=openstack-sahara-api state=stopped enabled=no
         - name: Set fact for removal of openstack-sahara-api package
           when: step|int == 2
@@ -164,4 +168,6 @@ outputs:
         - name: Remove openstack-sahara-api package if operator requests it
           yum: name=openstack-sahara-api state=removed
           ignore_errors: True
-          when: (remove_sahara_api_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_sahara_api_package|bool
diff --git a/docker/services/sahara-engine.yaml b/docker/services/sahara-engine.yaml
index 7d71b80e99..a1ca6ac9d9 100644
--- a/docker/services/sahara-engine.yaml
+++ b/docker/services/sahara-engine.yaml
@@ -137,10 +137,14 @@ outputs:
           register: sahara_engine_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-sahara-engine is running"
           command: systemctl is-active --quiet openstack-sahara-engine
-          when: (sahara_engine_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - sahara_engine_enabled.rc == 0
           tags: validation
         - name: Stop and disable sahara_engine service
-          when: (sahara_engine_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - sahara_engine_enabled.rc == 0
           service: name=openstack-sahara-engine state=stopped enabled=no
         - name: Set fact for removal of openstack-sahara-engine package
           when: step|int == 2
@@ -149,4 +153,6 @@ outputs:
         - name: Remove openstack-sahara-engine package if operator requests it
           yum: name=openstack-sahara-engine state=removed
           ignore_errors: True
-          when: (remove_sahara_engine_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_sahara_engine_package|bool
diff --git a/docker/services/sensu-client.yaml b/docker/services/sensu-client.yaml
index 3411e25dc0..de787c122d 100644
--- a/docker/services/sensu-client.yaml
+++ b/docker/services/sensu-client.yaml
@@ -160,8 +160,12 @@ outputs:
           register: sensu_enabled
         - name: "PreUpgrade step0,validation: Check if sensu client is running"
           command: systemctl is-active --quiet sensu-client
-          when: (sensu_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - sensu_enabled.rc == 0
           tags: validation
         - name: Stop and disable sensu-client service
-          when: (sensu_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - sensu_enabled.rc == 0
           service: name=sensu-client state=stopped enabled=no
diff --git a/docker/services/swift-proxy.yaml b/docker/services/swift-proxy.yaml
index 04b2d15932..35d340ccb9 100644
--- a/docker/services/swift-proxy.yaml
+++ b/docker/services/swift-proxy.yaml
@@ -157,11 +157,15 @@ outputs:
             - openstack-swift-object-expirer
         - name: "PreUpgrade step0,validation: Check service openstack-swift-proxy and openstack-swift-object-expirer are running"
           command: systemctl is-active --quiet "{{ item.item }}"
-          when: (item.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - item.rc == 0
           tags: validation
           with_items: "{{ swift_proxy_services_enabled.results }}"
         - name: Stop and disable swift-proxy and swift-object-expirer services
-          when: (item.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - item.rc == 0
           service: name={{ item.item }} state=stopped enabled=no
           with_items: "{{ swift_proxy_services_enabled.results }}"
         - name: Set fact for removal of openstack-swift-proxy package
@@ -171,6 +175,8 @@ outputs:
         - name: Remove openstack-swift-proxy package if operator requests it
           yum: name=openstack-swift-proxy state=removed
           ignore_errors: True
-          when: (remove_swift_proxy_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_swift_proxy_package|bool
       metadata_settings:
         get_attr: [SwiftProxyBase, role_data, metadata_settings]
diff --git a/docker/services/swift-storage.yaml b/docker/services/swift-storage.yaml
index e35cd0d7f5..b9ada58e2a 100644
--- a/docker/services/swift-storage.yaml
+++ b/docker/services/swift-storage.yaml
@@ -504,11 +504,15 @@ outputs:
           command: systemctl is-active --quiet "{{ item.item }}"
           tags: validation
           with_items: "{{ swift_services_enabled.results }}"
-          when: (item.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - item.rc == 0
         - name: Stop and disable swift storage services
           service: name={{ item.item }} state=stopped enabled=no
           with_items: "{{ swift_services_enabled.results }}"
-          when: (item.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - item.rc == 0
         - name: Set fact for removal of openstack-swift-container,object,account package
           when: step|int == 2
           set_fact:
@@ -516,7 +520,9 @@ outputs:
         - name: Remove openstack-swift-container,object,account packages if operator requests it
           yum: name={{ item }} state=removed
           ignore_errors: True
-          when: (remove_swift_package|bool) and (step|int == 2)
+          when:
+            - step|int == 2
+            - remove_swift_package|bool
           with_items:
             - openstack-swift-container
             - openstack-swift-object
diff --git a/docker/services/tacker.yaml b/docker/services/tacker.yaml
index ad560b16e6..8af0b51557 100644
--- a/docker/services/tacker.yaml
+++ b/docker/services/tacker.yaml
@@ -150,8 +150,12 @@ outputs:
           register: tacker_enabled
         - name: "PreUpgrade step0,validation: Check if tacker is running"
           command: systemctl is-active --quiet openstack-tacker-server
-          when: (tacker_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - tacker_enabled.rc == 0
           tags: validation
         - name: Stop and disable tacker-server service
-          when: (tacker_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - tacker_enabled.rc == 0
           service: name=openstack-tacker-server state=stopped enabled=no
diff --git a/docker/services/zaqar.yaml b/docker/services/zaqar.yaml
index 3e1a7adf0c..221e259efe 100644
--- a/docker/services/zaqar.yaml
+++ b/docker/services/zaqar.yaml
@@ -208,9 +208,15 @@ outputs:
         - name: "PreUpgrade step0,validation: Check if zaqar_wsgi is running"
           shell: systemctl status 'httpd' | grep -q zaqar_wsgi
           tags: validation
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
         - name: Stop and disable zaqar service
-          when: (httpd_enabled.rc == 0) and (httpd_running.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - httpd_enabled.rc == 0
+            - httpd_running.rc == 0
           service: name=httpd state=stopped enabled=no
       metadata_settings:
         get_attr: [ZaqarBase, role_data, metadata_settings]
diff --git a/puppet/services/aodh-evaluator.yaml b/puppet/services/aodh-evaluator.yaml
index 9e26ca527f..63a218d256 100644
--- a/puppet/services/aodh-evaluator.yaml
+++ b/puppet/services/aodh-evaluator.yaml
@@ -63,8 +63,12 @@ outputs:
           register: aodh_evaluator_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-evaluator is running"
           shell: /usr/bin/systemctl show 'openstack-aodh-evaluator' --property ActiveState | grep '\bactive\b'
-          when: (aodh_evaluator_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - aodh_evaluator_enabled.rc == 0
           tags: validation
         - name: Stop aodh_evaluator service
-          when: (aodh_evaluator_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - aodh_evaluator_enabled.rc == 0
           service: name=openstack-aodh-evaluator state=stopped
diff --git a/puppet/services/aodh-listener.yaml b/puppet/services/aodh-listener.yaml
index 49510e427f..2c61a13acb 100644
--- a/puppet/services/aodh-listener.yaml
+++ b/puppet/services/aodh-listener.yaml
@@ -63,8 +63,12 @@ outputs:
           register: aodh_listener_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-listener is running"
           shell: /usr/bin/systemctl show 'openstack-aodh-listener' --property ActiveState | grep '\bactive\b'
-          when: (aodh_listener_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - aodh_listener_enabled.rc == 0
           tags: validation
         - name: Stop aodh_listener service
-          when: (aodh_listener_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - aodh_listener_enabled.rc == 0
           service: name=openstack-aodh-listener state=stopped
diff --git a/puppet/services/aodh-notifier.yaml b/puppet/services/aodh-notifier.yaml
index a2e8eb762b..decb014f31 100644
--- a/puppet/services/aodh-notifier.yaml
+++ b/puppet/services/aodh-notifier.yaml
@@ -63,8 +63,12 @@ outputs:
           register: aodh_notifier_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-aodh-notifier is running"
           shell: /usr/bin/systemctl show 'openstack-aodh-notifier' --property ActiveState | grep '\bactive\b'
-          when: (aodh_notifier_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - aodh_notifier_enabled.rc == 0
           tags: validation
         - name: Stop aodh_notifier service
-          when: (aodh_notifier_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - aodh_notifier_enabled.rc == 0
           service: name=openstack-aodh-notifier state=stopped
diff --git a/puppet/services/apache.j2.yaml b/puppet/services/apache.j2.yaml
index d6830ffab8..b8c04e71f8 100644
--- a/puppet/services/apache.j2.yaml
+++ b/puppet/services/apache.j2.yaml
@@ -132,7 +132,9 @@ outputs:
           register: httpd_enabled
         - name: "PreUpgrade step0,validation: Check service httpd is running"
           shell: /usr/bin/systemctl show 'httpd' --property ActiveState | grep '\bactive\b'
-          when: (httpd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
           tags: validation
         - name: Ensure mod_ssl package is installed
           when: step|int == 3
diff --git a/puppet/services/auditd.yaml b/puppet/services/auditd.yaml
index b2bb7f857b..13b2d7d19d 100644
--- a/puppet/services/auditd.yaml
+++ b/puppet/services/auditd.yaml
@@ -54,8 +54,12 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'auditd' --property ActiveState |
             grep '\bactive\b'
-          when: (auditd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - auditd_enabled.rc == 0
           tags: validation
         - name: Stop auditd service
-          when: (auditd_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - auditd_enabled.rc == 0
           service: name=auditd state=stopped
diff --git a/puppet/services/barbican-api.yaml b/puppet/services/barbican-api.yaml
index 95863c318d..b0ff7a0df5 100644
--- a/puppet/services/barbican-api.yaml
+++ b/puppet/services/barbican-api.yaml
@@ -209,8 +209,12 @@ outputs:
               register: barbican_api_enabled
             - name: "PreUpgrade step0,validation: Check service openstack-barbican-api is running"
               shell: /usr/bin/systemctl show 'openstack-barbican-api' --property ActiveState | grep '\bactive\b'
-              when: (barbican_api_enabled.rc == 0) and (step|int == 0)
+              when:
+                - step|int == 0
+                - barbican_api_enabled.rc == 0
               tags: validation
             - name: Install openstack-barbican-api package if it was disabled
               yum: name=openstack-barbican-api state=latest
-              when: (barbican_api_enabled.rc != 0) and (step|int == 3)
+              when:
+                - step|int == 3
+                - barbican_api_enabled.rc != 0
diff --git a/puppet/services/ceilometer-agent-central.yaml b/puppet/services/ceilometer-agent-central.yaml
index c033a480cb..5a29ad2b5c 100644
--- a/puppet/services/ceilometer-agent-central.yaml
+++ b/puppet/services/ceilometer-agent-central.yaml
@@ -80,8 +80,12 @@ outputs:
           register: ceilometer_agent_central_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-central is running"
           shell: /usr/bin/systemctl show 'openstack-ceilometer-central' --property ActiveState | grep '\bactive\b'
-          when: (ceilometer_agent_central_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ceilometer_agent_central_enabled.rc == 0
           tags: validation
         - name: Stop ceilometer_agent_central service
-          when: (ceilometer_agent_central_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - ceilometer_agent_central_enabled.rc == 0
           service: name=openstack-ceilometer-central state=stopped
diff --git a/puppet/services/ceilometer-agent-compute.yaml b/puppet/services/ceilometer-agent-compute.yaml
index 945323fad4..c060255db8 100644
--- a/puppet/services/ceilometer-agent-compute.yaml
+++ b/puppet/services/ceilometer-agent-compute.yaml
@@ -79,8 +79,12 @@ outputs:
           register: ceilometer_agent_compute_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-compute is running"
           shell: /usr/bin/systemctl show 'openstack-ceilometer-compute' --property ActiveState | grep '\bactive\b'
-          when: (ceilometer_agent_compute_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ceilometer_agent_compute_enabled.rc == 0
           tags: validation
         - name: Stop ceilometer_agent_compute service
-          when: (ceilometer_agent_compute_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - ceilometer_agent_compute_enabled.rc == 0
           service: name=openstack-ceilometer-compute state=stopped
diff --git a/puppet/services/ceilometer-agent-ipmi.yaml b/puppet/services/ceilometer-agent-ipmi.yaml
index 236a3392b0..3c2fca480c 100644
--- a/puppet/services/ceilometer-agent-ipmi.yaml
+++ b/puppet/services/ceilometer-agent-ipmi.yaml
@@ -80,11 +80,17 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'openstack-ceilometer-ipmi' --property ActiveState |
             grep '\bactive\b'
-          when: (ceilometer_ipmi_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ceilometer_ipmi_enabled.rc == 0
           tags: validation
         - name: Stop openstack-ceilometer-ipmi service
-          when: (ceilometer_ipmi_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - ceilometer_ipmi_enabled.rc == 0
           service: name=openstack-ceilometer-ipmi state=stopped
         - name: Install openstack-ceilometer-ipmi package if it was disabled
           yum: name=openstack-ceilometer-ipmi state=latest
-          when: (ceilometer_ipmi_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - ceilometer_ipmi_enabled.rc != 0
diff --git a/puppet/services/ceilometer-agent-notification.yaml b/puppet/services/ceilometer-agent-notification.yaml
index 60e6fc4a82..a00f3d9587 100644
--- a/puppet/services/ceilometer-agent-notification.yaml
+++ b/puppet/services/ceilometer-agent-notification.yaml
@@ -74,8 +74,12 @@ outputs:
           register: ceilometer_agent_notification_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-ceilometer-notification is running"
           shell: /usr/bin/systemctl show 'openstack-ceilometer-notification' --property ActiveState | grep '\bactive\b'
-          when: (ceilometer_agent_notification_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ceilometer_agent_notification_enabled.rc == 0
           tags: validation
         - name: Stop ceilometer_agent_notification service
-          when: (ceilometer_agent_notification_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - ceilometer_agent_notification_enabled.rc == 0
           service: name=openstack-ceilometer-notification state=stopped
diff --git a/puppet/services/ceph-rgw.yaml b/puppet/services/ceph-rgw.yaml
index 2440a0b271..3af413eb76 100644
--- a/puppet/services/ceph-rgw.yaml
+++ b/puppet/services/ceph-rgw.yaml
@@ -104,10 +104,14 @@ outputs:
           register: ceph_rgw_enabled
         - name: Check status
           shell: /usr/bin/systemctl show ceph-radosgw@{{rgw_id.stdout}} --property ActiveState | grep '\bactive\b'
-          when: (ceph_rgw_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ceph_rgw_enabled.rc == 0
           tags: validation
         - name: Stop RGW instance
-          when: (ceph_rgw_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - ceph_rgw_enabled.rc == 0
           service:
             name: ceph-radosgw@{{rgw_id.stdout}}
             state: stopped
diff --git a/puppet/services/cinder-api.yaml b/puppet/services/cinder-api.yaml
index 1c8d4e6515..31c4c1ba84 100644
--- a/puppet/services/cinder-api.yaml
+++ b/puppet/services/cinder-api.yaml
@@ -194,7 +194,9 @@ outputs:
               register: cinder_api_enabled
             - name: "PreUpgrade step0,validation: Check service openstack-cinder-api is running"
               shell: /usr/bin/systemctl show 'openstack-cinder-api' --property ActiveState | grep '\bactive\b'
-              when: (cinder_api_enabled.rc == 0) and (step|int == 0)
+              when:
+                - step|int == 0
+                - cinder_api_enabled.rc == 0
               tags: validation
             - name: check for cinder running under apache (post upgrade)
               when: step|int == 1
@@ -203,7 +205,11 @@ outputs:
               ignore_errors: true
             - name: Stop cinder_api service (running under httpd)
               service: name=httpd state=stopped
-              when: (cinder_apache.rc == 0) and (step|int == 1)
+              when:
+                - step|int == 1
+                - cinder_apache.rc == 0
             - name: Stop and disable cinder_api service (pre-upgrade not under httpd)
-              when: (cinder_api_enabled.rc == 0) and (step|int == 1)
+              when:
+                - step|int == 1
+                - cinder_api_enabled.rc == 0
               service: name=openstack-cinder-api state=stopped enabled=no
diff --git a/puppet/services/cinder-scheduler.yaml b/puppet/services/cinder-scheduler.yaml
index 2ed04b5a10..c055b7fd6b 100644
--- a/puppet/services/cinder-scheduler.yaml
+++ b/puppet/services/cinder-scheduler.yaml
@@ -74,8 +74,12 @@ outputs:
           register: cinder_scheduler_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-cinder-scheduler is running"
           shell: /usr/bin/systemctl show 'openstack-cinder-scheduler' --property ActiveState | grep '\bactive\b'
-          when: (cinder_scheduler_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - cinder_scheduler_enabled.rc == 0
           tags: validation
         - name: Stop cinder_scheduler service
-          when: (cinder_scheduler_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - cinder_scheduler_enabled.rc == 0
           service: name=openstack-cinder-scheduler state=stopped
diff --git a/puppet/services/cinder-volume.yaml b/puppet/services/cinder-volume.yaml
index b4fa38f0be..db78c34f53 100644
--- a/puppet/services/cinder-volume.yaml
+++ b/puppet/services/cinder-volume.yaml
@@ -159,8 +159,12 @@ outputs:
           register: cinder_volume_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-cinder-volume is running"
           shell: /usr/bin/systemctl show 'openstack-cinder-volume' --property ActiveState | grep '\bactive\b'
-          when: (cinder_volume_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - cinder_volume_enabled.rc == 0
           tags: validation
         - name: Stop cinder_volume service
-          when: (cinder_volume_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - cinder_volume_enabled.rc == 0
           service: name=openstack-cinder-volume state=stopped
diff --git a/puppet/services/congress.yaml b/puppet/services/congress.yaml
index aab4ab7739..523dbfece4 100644
--- a/puppet/services/congress.yaml
+++ b/puppet/services/congress.yaml
@@ -148,11 +148,17 @@ outputs:
           register: congress_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-congress-server is running"
           shell: /usr/bin/systemctl show 'openstack-congress-server' --property ActiveState | grep '\bactive\b'
-          when: (congress_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - congress_enabled.rc == 0
           tags: validation
         - name: Stop congress service
-          when: (congress_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - congress_enabled.rc == 0
           service: name=openstack-congress-server state=stopped
         - name: Install openstack-congress package if it was disabled
           yum: name=openstack-congress state=latest
-          when: (congress_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - congress_enabled.rc != 0
diff --git a/puppet/services/database/redis.yaml b/puppet/services/database/redis.yaml
index a7cea42673..526d1bcf99 100644
--- a/puppet/services/database/redis.yaml
+++ b/puppet/services/database/redis.yaml
@@ -67,14 +67,20 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'redis' --property ActiveState |
             grep '\bactive\b'
-          when: (redis_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - redis_enabled.rc == 0
           tags: validation
         - name: Stop redis service
-          when: (redis_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - redis_enabled.rc == 0
           service: name=redis state=stopped
         - name: Install redis package if it was disabled
           yum: name=redis state=latest
-          when: (redis_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - redis_enabled.rc != 0
         - name: Start redis service
           when: step|int == 4
           service: name=redis state=started
diff --git a/puppet/services/disabled/heat-api-cloudwatch-disabled.yaml b/puppet/services/disabled/heat-api-cloudwatch-disabled.yaml
index 936fee781d..5065dde4be 100644
--- a/puppet/services/disabled/heat-api-cloudwatch-disabled.yaml
+++ b/puppet/services/disabled/heat-api-cloudwatch-disabled.yaml
@@ -43,5 +43,7 @@ outputs:
           ignore_errors: True
           register: heat_api_cloudwatch_enabled
         - name: Stop and disable heat_api_cloudwatch service (pre-upgrade not under httpd)
-          when: (heat_api_cloudwatch_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - heat_api_cloudwatch_enabled.rc == 0
           service: name=openstack-heat-api-cloudwatch state=stopped enabled=no
diff --git a/puppet/services/disabled/mongodb-disabled.yaml b/puppet/services/disabled/mongodb-disabled.yaml
index 47cf8d2060..1c95d0e337 100644
--- a/puppet/services/disabled/mongodb-disabled.yaml
+++ b/puppet/services/disabled/mongodb-disabled.yaml
@@ -43,4 +43,6 @@ outputs:
           register: mongod_service
         - name: Stop and disable mongodb service on upgrade
           service: name=mongod state=stopped enabled=no
-          when: (mongod_service.stat.exists) and (step|int == 1)
+          when:
+            - step|int == 1
+            - mongod_service.stat.exists
diff --git a/puppet/services/ec2-api.yaml b/puppet/services/ec2-api.yaml
index 36bb6cf7c6..d203b5a9c9 100644
--- a/puppet/services/ec2-api.yaml
+++ b/puppet/services/ec2-api.yaml
@@ -204,13 +204,19 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'openstack-ec2-api' --property ActiveState |
             grep '\bactive\b'
-          when: (ec2_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ec2_api_enabled.rc == 0
           tags: validation
         - name: Stop openstack-ec2-api service
-          when: (ec2_api_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - ec2_api_enabled.rc == 0
           service: name=openstack-ec2-api state=stopped
         - name: Install openstack-ec2-api package if it was disabled
           yum: name=openstack-ec2-api state=latest
-          when: (ec2_api_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - ec2_api_enabled.rc != 0
       metadata_settings:
         get_attr: [TLSProxyBase, role_data, metadata_settings]
diff --git a/puppet/services/etcd.yaml b/puppet/services/etcd.yaml
index 7aceceda50..0334fa58c8 100644
--- a/puppet/services/etcd.yaml
+++ b/puppet/services/etcd.yaml
@@ -106,7 +106,9 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'etcd' --property ActiveState |
             grep '\bactive\b'
-          when: (etcd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - etcd_enabled.rc == 0
           tags: validation
         - name: Stop etcd service
           when: step|int == 2
diff --git a/puppet/services/glance-api.yaml b/puppet/services/glance-api.yaml
index 1f6423edf0..99625fc876 100644
--- a/puppet/services/glance-api.yaml
+++ b/puppet/services/glance-api.yaml
@@ -300,10 +300,16 @@ outputs:
         - name: "PreUpgrade step0,validation: Check service openstack-glance-api is running"
           shell: /usr/bin/systemctl show 'openstack-glance-api' --property ActiveState | grep '\bactive\b'
           tags: validation
-          when: (glance_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - glance_api_enabled.rc == 0
         - name: Stop glance_api service
-          when: (glance_api_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - glance_api_enabled.rc == 0
           service: name=openstack-glance-api state=stopped
         - name: Stop and disable glance registry (removed for Ocata)
-          when: (glance_registry_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - glance_registry_enabled.rc == 0
           service: name=openstack-glance-registry state=stopped enabled=no
diff --git a/puppet/services/gnocchi-api.yaml b/puppet/services/gnocchi-api.yaml
index ec376b8892..d7f9de9ddb 100644
--- a/puppet/services/gnocchi-api.yaml
+++ b/puppet/services/gnocchi-api.yaml
@@ -171,4 +171,6 @@ outputs:
               set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
             - name: Setup gnocchi db during upgrade
               command: gnocchi-upgrade
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
diff --git a/puppet/services/gnocchi-metricd.yaml b/puppet/services/gnocchi-metricd.yaml
index dfceba706a..3bbf66191a 100644
--- a/puppet/services/gnocchi-metricd.yaml
+++ b/puppet/services/gnocchi-metricd.yaml
@@ -74,8 +74,12 @@ outputs:
           register: gnocchi_metricd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-metricd is running"
           shell: /usr/bin/systemctl show 'openstack-gnocchi-metricd' --property ActiveState | grep '\bactive\b'
-          when: (gnocchi_metricd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - gnocchi_metricd_enabled.rc == 0
           tags: validation
         - name: Stop gnocchi_metricd service
-          when: (gnocchi_metricd_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - gnocchi_metricd_enabled.rc == 0
           service: name=openstack-gnocchi-metricd state=stopped
diff --git a/puppet/services/gnocchi-statsd.yaml b/puppet/services/gnocchi-statsd.yaml
index ec396f711d..2b22898e67 100644
--- a/puppet/services/gnocchi-statsd.yaml
+++ b/puppet/services/gnocchi-statsd.yaml
@@ -68,8 +68,12 @@ outputs:
           register: gnocchi_statsd_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-gnocchi-statsd is running"
           shell: /usr/bin/systemctl show 'openstack-gnocchi-statsd' --property ActiveState | grep '\bactive\b'
-          when: (gnocchi_statsd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - gnocchi_statsd_enabled.rc == 0
           tags: validation
         - name: Stop gnocchi_statsd service
-          when: (gnocchi_statsd_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - gnocchi_statsd_enabled.rc == 0
           service: name=openstack-gnocchi-statsd state=stopped
diff --git a/puppet/services/haproxy.yaml b/puppet/services/haproxy.yaml
index 5707b6bebd..04a06c9c5a 100644
--- a/puppet/services/haproxy.yaml
+++ b/puppet/services/haproxy.yaml
@@ -156,13 +156,19 @@ outputs:
           register: haproxy_enabled
         - name: "PreUpgrade step0,validation: Check service haproxy is running"
           shell: /usr/bin/systemctl show 'haproxy' --property ActiveState | grep '\bactive\b'
-          when: (haproxy_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - haproxy_enabled.rc == 0
           tags: validation
         - name: Stop haproxy service
-          when: (haproxy_enabled.rc == 0) and (step|int == 2)
+          when:
+            - step|int == 2
+            - haproxy_enabled.rc == 0
           service: name=haproxy state=stopped
         - name: Start haproxy service
-          when: (haproxy_enabled.rc == 0) and (step|int == 4)
+          when:
+            - step|int == 4
+            - haproxy_enabled.rc == 0
           service: name=haproxy state=started
       metadata_settings:
         list_concat:
diff --git a/puppet/services/heat-api-cfn.yaml b/puppet/services/heat-api-cfn.yaml
index 7d0f39405d..4dcc275552 100644
--- a/puppet/services/heat-api-cfn.yaml
+++ b/puppet/services/heat-api-cfn.yaml
@@ -140,7 +140,9 @@ outputs:
           register: heat_api_cfn_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-api-cfn is running"
           shell: /usr/bin/systemctl show 'openstack-heat-api-cfn' --property ActiveState | grep '\bactive\b'
-          when: (heat_api_cfn_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - heat_api_cfn_enabled.rc == 0
           tags: validation
         - name: check for heat_api_cfn running under apache (post upgrade)
           when: step|int == 1
@@ -149,7 +151,11 @@ outputs:
           ignore_errors: true
         - name: Stop heat_api_cfn service (running under httpd)
           service: name=httpd state=stopped
-          when: (heat_api_cfn_apache.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - heat_api_cfn_apache.rc == 0
         - name: Stop and disable heat_api_cfn service (pre-upgrade not under httpd)
-          when: (heat_api_cfn_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - heat_api_cfn_enabled.rc == 0
           service: name=openstack-heat-api-cfn state=stopped enabled=no
diff --git a/puppet/services/heat-api.yaml b/puppet/services/heat-api.yaml
index 6d33d9b5c8..b23c4af447 100644
--- a/puppet/services/heat-api.yaml
+++ b/puppet/services/heat-api.yaml
@@ -147,7 +147,9 @@ outputs:
           register: heat_api_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-api is running"
           shell: /usr/bin/systemctl show 'openstack-heat-api' --property ActiveState | grep '\bactive\b'
-          when: (heat_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - heat_api_enabled.rc == 0
           tags: validation
         - name: check for heat_api running under apache (post upgrade)
           when: step|int == 1
@@ -156,7 +158,11 @@ outputs:
           ignore_errors: true
         - name: Stop heat_api service (running under httpd)
           service: name=httpd state=stopped
-          when: (heat_api_apache.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - heat_api_apache.rc == 0
         - name: Stop and disable heat_api service (pre-upgrade not under httpd)
-          when: (heat_api_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - heat_api_enabled.rc == 0
           service: name=openstack-heat-api state=stopped enabled=no
diff --git a/puppet/services/heat-engine.yaml b/puppet/services/heat-engine.yaml
index 108936574d..edb61c9d6f 100644
--- a/puppet/services/heat-engine.yaml
+++ b/puppet/services/heat-engine.yaml
@@ -163,8 +163,12 @@ outputs:
           register: heat_engine_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-heat-engine is running"
           shell: /usr/bin/systemctl show 'openstack-heat-engine' --property ActiveState | grep '\bactive\b'
-          when: (heat_engine_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - heat_engine_enabled.rc == 0
           tags: validation
         - name: Stop heat_engine service
-          when: (heat_engine_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - heat_engine_enabled.rc == 0
           service: name=openstack-heat-engine state=stopped
diff --git a/puppet/services/horizon.yaml b/puppet/services/horizon.yaml
index c93ec2b4ab..4b422f7c94 100644
--- a/puppet/services/horizon.yaml
+++ b/puppet/services/horizon.yaml
@@ -154,10 +154,14 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'httpd' --property ActiveState |
             grep '\bactive\b'
-          when: (httpd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - httpd_enabled.rc == 0
           tags: validation
         - name: Stop Horizon (under httpd)
-          when: (httpd_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - httpd_enabled.rc == 0
           service: name=httpd state=stopped
       service_config_settings:
         haproxy:
diff --git a/puppet/services/logging/fluentd.yaml b/puppet/services/logging/fluentd.yaml
index 5788b9e742..9f00fed386 100644
--- a/puppet/services/logging/fluentd.yaml
+++ b/puppet/services/logging/fluentd.yaml
@@ -87,11 +87,17 @@ outputs:
           shell: >
             /usr/bin/systemctl show fluentd --property ActiveState |
             grep '\bactive\b'
-          when: (fluentd_client_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - fluentd_client_enabled.rc == 0
           tags: validation
         - name: Stop fluentd service
-          when: (fluentd_client_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - fluentd_client_enabled.rc == 0
           service: name=fluentd state=stopped
         - name: Install fluentd package if it was disabled
           yum: name=fluentd state=latest
-          when: (fluentd_client_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - fluentd_client_enabled.rc != 0
diff --git a/puppet/services/metrics/collectd.yaml b/puppet/services/metrics/collectd.yaml
index d621ea0b9f..a5445f06ce 100644
--- a/puppet/services/metrics/collectd.yaml
+++ b/puppet/services/metrics/collectd.yaml
@@ -285,11 +285,17 @@ outputs:
           shell: >
             /usr/bin/systemctl show collectd --property ActiveState |
             grep '\bactive\b'
-          when: (collectd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - collectd_enabled.rc == 0
           tags: validation
         - name: Stop collectd service
-          when: (collectd_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - collectd_enabled.rc == 0
           service: name=collectd state=stopped
         - name: Install collectd package if it was disabled
           yum: name=collectd state=latest
-          when: (collectd_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - collectd_enabled.rc != 0
diff --git a/puppet/services/mistral-api.yaml b/puppet/services/mistral-api.yaml
index 94843ee106..2f339538f2 100644
--- a/puppet/services/mistral-api.yaml
+++ b/puppet/services/mistral-api.yaml
@@ -109,7 +109,9 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'openstack-mistral-api' --property ActiveState |
             grep '\bactive\b'
-          when: (mistral_api_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mistral_api_enabled.rc == 0
           tags: validation
         - name: check for mistral_api running under apache (post upgrade)
           when: step|int == 1
@@ -118,7 +120,11 @@ outputs:
           ignore_errors: true
         - name: Stop mistral_api service (running under httpd)
           service: name=httpd state=stopped
-          when: (mistral_api_apache.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - mistral_api_apache.rc == 0
         - name: Stop and disable mistral_api service (pre-upgrade not under httpd)
-          when: (mistral_api_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - mistral_api_enabled.rc == 0
           service: name=openstack-mistral-api state=stopped enabled=no
diff --git a/puppet/services/mistral-engine.yaml b/puppet/services/mistral-engine.yaml
index a9dbe3474e..4d32ab8a26 100644
--- a/puppet/services/mistral-engine.yaml
+++ b/puppet/services/mistral-engine.yaml
@@ -68,11 +68,15 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'openstack-mistral-engine' --property ActiveState |
             grep '\bactive\b'
-          when: (mistral_engine_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mistral_engine_enabled.rc == 0
           tags: validation
         - name: Stop mistral_engine service
           when: step|int == 1
           service: name=openstack-mistral-engine state=stopped
         - name: Install openstack-mistral-engine package if it was disabled
           yum: name=openstack-mistral-engine state=latest
-          when: (mistral_engine_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - mistral_engine_enabled.rc != 0
diff --git a/puppet/services/mistral-event-engine.yaml b/puppet/services/mistral-event-engine.yaml
index 700edc7661..31f1531f91 100644
--- a/puppet/services/mistral-event-engine.yaml
+++ b/puppet/services/mistral-event-engine.yaml
@@ -61,11 +61,15 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'openstack-mistral-event-engine' --property ActiveState |
             grep '\bactive\b'
-          when: (mistral_event_engine_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mistral_event_engine_enabled.rc == 0
           tags: validation
         - name: Stop mistral_event_engine service
           when: step|int == 1
           service: name=openstack-mistral-event-engine state=stopped
         - name: Install openstack-mistral-event-engine package if it was disabled
           yum: name=openstack-mistral-event-engine state=latest
-          when: (mistral_event_engine_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - mistral_event_engine_enabled.rc != 0
diff --git a/puppet/services/mistral-executor.yaml b/puppet/services/mistral-executor.yaml
index 377ccd41f4..f329b03741 100644
--- a/puppet/services/mistral-executor.yaml
+++ b/puppet/services/mistral-executor.yaml
@@ -61,11 +61,15 @@ outputs:
           shell: >
             /usr/bin/systemctl show 'openstack-mistral-executor' --property ActiveState |
             grep '\bactive\b'
-          when: (mistral_executor_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - mistral_executor_enabled.rc == 0
           tags: validation
         - name: Stop mistral_executor service
           when: step|int == 1
           service: name=openstack-mistral-executor state=stopped
         - name: Install openstack-mistral-executor package if it was disabled
           yum: name=openstack-mistral-executor state=latest
-          when: (mistral_executor_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - mistral_executor_enabled.rc != 0
diff --git a/puppet/services/monitoring/sensu-client.yaml b/puppet/services/monitoring/sensu-client.yaml
index 873eafefd5..c571ea5b2f 100644
--- a/puppet/services/monitoring/sensu-client.yaml
+++ b/puppet/services/monitoring/sensu-client.yaml
@@ -88,11 +88,17 @@ outputs:
           shell: >
             /usr/bin/systemctl show sensu-client --property ActiveState |
             grep '\bactive\b'
-          when: (sensu_client_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - sensu_client_enabled.rc == 0
           tags: validation
         - name: Stop sensu-client service
-          when: (sensu_client_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - sensu_client_enabled.rc == 0
           service: name=sensu-client state=stopped
         - name: Install sensu package if it was disabled
           yum: name=sensu state=latest
-          when: (sensu_client_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - sensu_client_enabled.rc != 0
diff --git a/puppet/services/neutron-api.yaml b/puppet/services/neutron-api.yaml
index 6d4381b52a..d67df04da7 100644
--- a/puppet/services/neutron-api.yaml
+++ b/puppet/services/neutron-api.yaml
@@ -229,10 +229,14 @@ outputs:
           register: neutron_server_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-server is running"
           shell: /usr/bin/systemctl show 'neutron-server' --property ActiveState | grep '\bactive\b'
-          when: (neutron_server_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_server_enabled.rc == 0
           tags: validation
         - name: Stop neutron_api service
-          when: (neutron_server_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - neutron_server_enabled.rc == 0
           service: name=neutron-server state=stopped
       metadata_settings:
         get_attr: [TLSProxyBase, role_data, metadata_settings]
diff --git a/puppet/services/neutron-dhcp.yaml b/puppet/services/neutron-dhcp.yaml
index 871501b252..ae2f513dab 100644
--- a/puppet/services/neutron-dhcp.yaml
+++ b/puppet/services/neutron-dhcp.yaml
@@ -125,8 +125,12 @@ outputs:
           register: neutron_dhcp_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-dhcp-agent is running"
           shell: /usr/bin/systemctl show 'neutron-dhcp-agent' --property ActiveState | grep '\bactive\b'
-          when: (neutron_dhcp_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_dhcp_agent_enabled.rc == 0
           tags: validation
         - name: Stop neutron_dhcp service
-          when: (neutron_dhcp_agent_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - neutron_dhcp_agent_enabled.rc == 0
           service: name=neutron-dhcp-agent state=stopped
diff --git a/puppet/services/neutron-l2gw-agent.yaml b/puppet/services/neutron-l2gw-agent.yaml
index ff49bb1e03..a29ada854e 100644
--- a/puppet/services/neutron-l2gw-agent.yaml
+++ b/puppet/services/neutron-l2gw-agent.yaml
@@ -118,8 +118,12 @@ outputs:
           register: neutron_l2gw_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-l2gw-agent is running"
           shell: /usr/bin/systemctl show 'neutron-l2gw-agent' --property ActiveState | grep '\bactive\b'
-          when: (neutron_l2gw_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_l2gw_agent_enabled.rc == 0
           tags: validation
         - name: Stop neutron_l2gw_agent service
-          when: (neutron_l2gw_agent_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - neutron_l2gw_agent_enabled.rc == 0
           service: name=neutron-l2gw-agent state=stopped
diff --git a/puppet/services/neutron-l3.yaml b/puppet/services/neutron-l3.yaml
index 1b9ca2f889..c071c31f24 100644
--- a/puppet/services/neutron-l3.yaml
+++ b/puppet/services/neutron-l3.yaml
@@ -119,8 +119,12 @@ outputs:
           register: neutron_l3_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-l3-agent is running"
           shell: /usr/bin/systemctl show 'neutron-l3-agent' --property ActiveState | grep '\bactive\b'
-          when: (neutron_l3_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_l3_agent_enabled.rc == 0
           tags: validation
         - name: Stop neutron_l3 service
-          when: (neutron_l3_agent_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - neutron_l3_agent_enabled.rc == 0
           service: name=neutron-l3-agent state=stopped
diff --git a/puppet/services/neutron-metadata.yaml b/puppet/services/neutron-metadata.yaml
index 02643fadde..819a88c3ca 100644
--- a/puppet/services/neutron-metadata.yaml
+++ b/puppet/services/neutron-metadata.yaml
@@ -136,8 +136,12 @@ outputs:
           register: neutron_metadata_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-metadata-agent is running"
           shell: /usr/bin/systemctl show 'neutron-metadata-agent' --property ActiveState | grep '\bactive\b'
-          when: (neutron_metadata_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_metadata_agent_enabled.rc == 0
           tags: validation
         - name: Stop neutron_metadata service
-          when: (neutron_metadata_agent_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - neutron_metadata_agent_enabled.rc == 0
           service: name=neutron-metadata-agent state=stopped
diff --git a/puppet/services/neutron-ovs-agent.yaml b/puppet/services/neutron-ovs-agent.yaml
index 2f73f867e4..7e0dd30db2 100644
--- a/puppet/services/neutron-ovs-agent.yaml
+++ b/puppet/services/neutron-ovs-agent.yaml
@@ -172,8 +172,12 @@ outputs:
               register: neutron_ovs_agent_enabled
             - name: "PreUpgrade step0,validation: Check service neutron-openvswitch-agent is running"
               shell: /usr/bin/systemctl show 'neutron-openvswitch-agent' --property ActiveState | grep '\bactive\b'
-              when: (neutron_ovs_agent_enabled.rc == 0) and (step|int == 0)
+              when:
+                - step|int == 0
+                - neutron_ovs_agent_enabled.rc == 0
               tags: validation
             - name: Stop neutron_ovs_agent service
-              when: (neutron_ovs_agent_enabled.rc == 0) and (step|int == 1)
+              when:
+                - step|int == 1
+                - neutron_ovs_agent_enabled.rc == 0
               service: name=neutron-openvswitch-agent state=stopped
diff --git a/puppet/services/neutron-sriov-agent.yaml b/puppet/services/neutron-sriov-agent.yaml
index 7f2c96dbb2..fc99ee25a7 100644
--- a/puppet/services/neutron-sriov-agent.yaml
+++ b/puppet/services/neutron-sriov-agent.yaml
@@ -122,8 +122,12 @@ outputs:
           register: neutron_sriov_nic_agent_enabled
         - name: "PreUpgrade step0,validation: Check service neutron-server is running"
           shell: /usr/bin/systemctl show 'neutron-sriov-nic-agent' --property ActiveState | grep '\bactive\b'
-          when: (neutron_sriov_nic_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - neutron_sriov_nic_agent_enabled.rc == 0
           tags: validation
         - name: Stop neutron_sriov_nic_agent service
-          when: (neutron_sriov_nic_agent_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - neutron_sriov_nic_agent_enabled.rc == 0
           service: name=neutron-sriov-nic-agent state=stopped
diff --git a/puppet/services/nova-api.yaml b/puppet/services/nova-api.yaml
index 98584c5f0e..2cdacb05e9 100644
--- a/puppet/services/nova-api.yaml
+++ b/puppet/services/nova-api.yaml
@@ -209,13 +209,17 @@ outputs:
               set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
             - name: Extra migration for nova tripleo/+bug/1656791
               tags: pre-upgrade
-              when: (is_bootstrap_node) and (step|int == 0)
+              when:
+                - step|int == 0
+                - is_bootstrap_node|bool
               command: nova-manage db online_data_migrations
             - name: Stop and disable nova_api service (pre-upgrade not under httpd)
               when: step|int == 2
               service: name=openstack-nova-api state=stopped enabled=no
             - name: Create puppet manifest to set transport_url in nova.conf
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               copy:
                 dest: /root/nova-api_upgrade_manifest.pp
                 mode: 0600
@@ -232,16 +236,22 @@ outputs:
                     transport_url => $transport_url
                   }
             - name: Run puppet apply to set tranport_url in nova.conf
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               command: puppet apply --summarize --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --detailed-exitcodes /root/nova-api_upgrade_manifest.pp
               register: puppet_apply_nova_api_upgrade
               failed_when: puppet_apply_nova_api_upgrade.rc not in [0,2]
               changed_when: puppet_apply_nova_api_upgrade.rc == 2
             - name: Setup cell_v2 (map cell0)
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               shell: nova-manage cell_v2 map_cell0 --database_connection=$(hiera nova::cell0_database_connection)
             - name: Setup cell_v2 (create default cell)
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               # (owalsh) puppet-nova expects the cell name 'default'
               # (owalsh) pass the db uri explicitly to avoid https://bugs.launchpad.net/tripleo/+bug/1662344
               shell: nova-manage cell_v2 create_cell --name='default' --database_connection=$(hiera nova::database_connection)
@@ -249,23 +259,35 @@ outputs:
               failed_when: nova_api_create_cell.rc not in [0,2]
               changed_when: nova_api_create_cell.rc == 0
             - name: Setup cell_v2 (sync nova/cell DB)
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               command: nova-manage db sync
               async: {get_param: NovaDbSyncTimeout}
               poll: 10
             - name: Setup cell_v2 (get cell uuid)
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               shell: nova-manage cell_v2 list_cells | sed -e '1,3d' -e '$d' | awk -F ' *| *' '$2 == "default" {print $4}'
               register: nova_api_cell_uuid
             - name: Setup cell_v2 (migrate hosts)
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               command: nova-manage cell_v2 discover_hosts --cell_uuid {{nova_api_cell_uuid.stdout}} --verbose
             - name: Setup cell_v2 (migrate instances)
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               command: nova-manage cell_v2 map_instances --cell_uuid {{nova_api_cell_uuid.stdout}}
             - name: Sync nova_api DB
               command: nova-manage api_db sync
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
             - name: Online data migration for nova
-              when: (is_bootstrap_node) and (step|int == 5)
+              when:
+                - step|int == 5
+                - is_bootstrap_node|bool
               command: nova-manage db online_data_migrations
diff --git a/puppet/services/opendaylight-api.yaml b/puppet/services/opendaylight-api.yaml
index 2ef3cae596..8a7d2cf661 100644
--- a/puppet/services/opendaylight-api.yaml
+++ b/puppet/services/opendaylight-api.yaml
@@ -170,10 +170,14 @@ outputs:
           register: opendaylight_enabled
         - name: "PreUpgrade step0,validation: Check service opendaylight is running"
           shell: /usr/bin/systemctl show 'opendaylight' --property ActiveState | grep '\bactive\b'
-          when: (opendaylight_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - opendaylight_enabled.rc == 0
           tags: validation
         - name: Stop opendaylight service
-          when: (opendaylight_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - opendaylight_enabled.rc == 0
           service: name=opendaylight state=stopped
         - name: Removes ODL snapshots, data, journal directories
           file:
diff --git a/puppet/services/opendaylight-ovs.yaml b/puppet/services/opendaylight-ovs.yaml
index 204c5ed935..3390645eab 100644
--- a/puppet/services/opendaylight-ovs.yaml
+++ b/puppet/services/opendaylight-ovs.yaml
@@ -220,10 +220,14 @@ outputs:
               register: openvswitch_enabled
             - name: "PreUpgrade step0,validation: Check service openvswitch is running"
               command: systemctl is-active --quiet openvswitch
-              when: (openvswitch_enabled.rc == 0) and (step|int == 0)
+              when:
+                - step|int == 0
+                - openvswitch_enabled.rc == 0
               tags: validation
             - name: Stop openvswitch service
-              when: (openvswitch_enabled.rc == 0) and (step|int == 1)
+              when:
+                - step|int == 1
+                - openvswitch_enabled.rc == 0
               service: name=openvswitch state=stopped
               # Container upgrade steps.
             - name: Block connections to ODL. #This rule will be inserted at the top.
diff --git a/puppet/services/openvswitch.yaml b/puppet/services/openvswitch.yaml
index 1a70e93d96..710eaede9a 100644
--- a/puppet/services/openvswitch.yaml
+++ b/puppet/services/openvswitch.yaml
@@ -188,6 +188,7 @@ outputs:
                 chdir: /root/OVS_UPGRADE
               with_items:
                 - "{{ovs_list_of_rpms.stdout_lines}}"
-          when: ("'2.5.0-14' in ovs_version.stdout|default('')
-                or
-                ovs_packaging_issue|default(false)|succeeded") and (step|int == 2)
+          when:
+            - step|int == 2
+            - "'2.5.0-14' in ovs_version.stdout|default('') or
+              ovs_packaging_issue|default(false)|succeeded"
diff --git a/puppet/services/ovn-controller.yaml b/puppet/services/ovn-controller.yaml
index 18cb9665d2..8be5586303 100644
--- a/puppet/services/ovn-controller.yaml
+++ b/puppet/services/ovn-controller.yaml
@@ -113,8 +113,12 @@ outputs:
           register: ovn_controller_enabled
         - name: "PreUpgrade step0,validation: Check service ovn-controller is running"
           shell: /usr/bin/systemctl show 'ovn-controller' --property ActiveState | grep '\bactive\b'
-          when: (ovn_controller_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ovn_controller_enabled.rc == 0
           tags: validation
         - name: Stop ovn-controller service
-          when: (ovn_controller_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - ovn_controller_enabled.rc == 0
           service: name=ovn-controller state=stopped
diff --git a/puppet/services/ovn-dbs.yaml b/puppet/services/ovn-dbs.yaml
index eb4ce1e3c2..f9031721bb 100644
--- a/puppet/services/ovn-dbs.yaml
+++ b/puppet/services/ovn-dbs.yaml
@@ -65,8 +65,12 @@ outputs:
           register: ovn_northd_enabled
         - name: "PreUpgrade step0,validation: Check service ovn-northd is running"
           shell: /usr/bin/systemctl show 'ovn-northd' --property ActiveState | grep '\bactive\b'
-          when: (ovn_northd_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - ovn_northd_enabled.rc == 0
           tags: validation
         - name: Stop ovn-northd service
-          when: (ovn_northd_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - ovn_northd_enabled.rc == 0
           service: name=ovn-northd state=stopped
diff --git a/puppet/services/ovn-metadata.yaml b/puppet/services/ovn-metadata.yaml
index 2f74c137cd..f371772460 100644
--- a/puppet/services/ovn-metadata.yaml
+++ b/puppet/services/ovn-metadata.yaml
@@ -115,8 +115,12 @@ outputs:
           register: networking_ovn_metadata_agent_enabled
         - name: "PreUpgrade step0,validation: Check service networking-ovn-metadata-agent is running"
           shell: /usr/bin/systemctl show 'networking-ovn-metadata-agent' --property ActiveState | grep '\bactive\b'
-          when: (networking_ovn_metadata_agent_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - networking_ovn_metadata_agent_enabled.rc == 0
           tags: validation
         - name: Stop networking_ovn_metadata service
-          when: (neutron_metadata_agent_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - neutron_metadata_agent_enabled.rc == 0
           service: name=networking-ovn-metadata-agent state=stopped
diff --git a/puppet/services/panko-api.yaml b/puppet/services/panko-api.yaml
index e69cadec63..d4a1446552 100644
--- a/puppet/services/panko-api.yaml
+++ b/puppet/services/panko-api.yaml
@@ -129,11 +129,15 @@ outputs:
               shell: >
                 /usr/bin/systemctl show 'httpd' --property ActiveState |
                 grep '\bactive\b'
-              when: (httpd_enabled.rc == 0) and (step|int == 0)
+              when:
+                - step|int == 0
+                - httpd_enabled.rc == 0
               tags: validation
             - name: Stop panko-api service (running under httpd)
               service: name=httpd state=stopped
-              when: (httpd_enabled.rc == 0) and (step|int == 1)
+              when:
+                - step|int == 1
+                - httpd_enabled.rc == 0
             - name: Install openstack-panko-api package if it was not installed
               when: step|int == 3
               yum: name=openstack-panko-api state=latest
diff --git a/puppet/services/tacker.yaml b/puppet/services/tacker.yaml
index f0ec2e5475..fe6127958c 100644
--- a/puppet/services/tacker.yaml
+++ b/puppet/services/tacker.yaml
@@ -148,11 +148,17 @@ outputs:
           register: tacker_enabled
         - name: "PreUpgrade step0,validation: Check service openstack-tacker-server is running"
           shell: /usr/bin/systemctl show 'openstack-tacker-server' --property ActiveState | grep '\bactive\b'
-          when: (tacker_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - tacker_enabled.rc == 0
           tags: validation
         - name: Stop tacker service
-          when: (tacker_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - tacker_enabled.rc == 0
           service: name=openstack-tacker-server state=stopped
         - name: Install openstack-tacker package if it was disabled
           yum: name=openstack-tacker state=latest
-          when: (tacker_enabled.rc != 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - tacker_enabled.rc != 0
diff --git a/puppet/services/tripleo-packages.yaml b/puppet/services/tripleo-packages.yaml
index 4140c10f95..ccf281b143 100644
--- a/puppet/services/tripleo-packages.yaml
+++ b/puppet/services/tripleo-packages.yaml
@@ -51,7 +51,9 @@ outputs:
           register: rpm_python_check
         - name: Fail when rpm-python wasn't present
           fail: msg="rpm-python package was not present before this run! Check environment before re-running"
-          when: (rpm_python_check.changed != false) and (step|int == 0)
+          when:
+            - step|int == 0
+            - rpm_python_check.changed != false
         - name: Check for os-net-config upgrade
           shell: "yum check-upgrade | awk '/os-net-config/{print}'"
           register: os_net_config_need_upgrade
@@ -69,7 +71,10 @@ outputs:
               register: os_net_config_upgrade
               failed_when: os_net_config_upgrade.rc not in [0,2]
               changed_when: os_net_config_upgrade.rc == 2
-          when: (os_net_config_need_upgrade.stdout and os_net_config_has_config.rc == 0) and (step|int == 3)
+          when:
+            - step|int == 3
+            - os_net_config_need_upgrade.stdout
+            - os_net_config_has_config.rc == 0
         - name: Update all packages
           when: step|int == 3
           yum: name=* state=latest
diff --git a/puppet/services/vpp.yaml b/puppet/services/vpp.yaml
index 89fa66992f..baa61f39da 100644
--- a/puppet/services/vpp.yaml
+++ b/puppet/services/vpp.yaml
@@ -61,8 +61,12 @@ outputs:
           register: vpp_enabled
         - name: "PreUpgrade step0,validation: Check service vpp is running"
           shell: /usr/bin/systemctl show 'vpp' --property ActiveState | grep '\bactive\b'
-          when: (vpp_enabled.rc == 0) and (step|int == 0)
+          when:
+            - step|int == 0
+            - vpp_enabled.rc == 0
           tags: validation
         - name: Stop vpp service
-          when: (vpp_enabled.rc == 0) and (step|int == 1)
+          when:
+            - step|int == 1
+            - vpp_enabled.rc == 0
           service: name=vpp state=stopped
diff --git a/puppet/services/zaqar-api.yaml b/puppet/services/zaqar-api.yaml
index 31c95a38d1..d48d7b9477 100644
--- a/puppet/services/zaqar-api.yaml
+++ b/puppet/services/zaqar-api.yaml
@@ -211,7 +211,9 @@ outputs:
               shell: >
                 /usr/bin/systemctl show 'openstack-zaqar' --property ActiveState |
                 grep '\bactive\b'
-              when: (zaqar_enabled.rc == 0) and (step|int == 0)
+              when:
+                - step|int == 0
+                - zaqar_enabled.rc == 0
               tags: validation
             - name: Check for zaqar running under apache (post upgrade)
               when: step|int == 1
@@ -220,10 +222,16 @@ outputs:
               ignore_errors: true
             - name: Stop zaqar service (running under httpd)
               service: name=httpd state=stopped
-              when: (zaqar_apache.rc == 0) and (step|int == 1)
+              when:
+                - step|int == 1
+                - zaqar_apache.rc == 0
             - name: Stop and disable zaqar service (pre-upgrade not under httpd)
-              when: (zaqar_enabled.rc == 0) and (step|int == 1)
+              when:
+                - step|int == 1
+                - zaqar_enabled.rc == 0
               service: name=openstack-zaqar state=stopped enabled=no
             - name: Install openstack-zaqar package if it was disabled
               yum: name=openstack-zaqar state=latest
-              when: (zaqar_enabled.rc != 0) and (step|int == 3)
+              when:
+                - step|int == 3
+                - zaqar_enabled.rc != 0