Always evaluate step first in conditional

If we use variables defined in later step in conditional before
checking which step are we on we will fail.

Resolves: rhbz#1535457
Closes-Bug: #1743764
Change-Id: Ic21f6eb5c4101f230fa894cd0829a11e2f0ef39b
This commit is contained in:
Lukas Bezdicka
2018-01-31 11:06:53 +01:00
parent a1c479f93c
commit 0cb5c847f3
131 changed files with 998 additions and 322 deletions

View File

@@ -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