Allow upgrade tasks to run when looping through steps

Currently for non controller upgrades we're looping through the
upgrade steps and run the upgrade tasks based on when conditionals
including the step number and the existing upgrade task condition.
Some of tasks fail because the variables used in when conditionals
are not available through all steps. This change adds default values
to these vars where possible or creates them for all steps to avoid
failures.

Related-Bug: 1708115
Change-Id: I5c731043cec8e31fc82ca98972a301baa7294c4f
This commit is contained in:
Marius Cornea 2017-08-31 10:32:30 +02:00
parent 5382605bff
commit e2f00ef1dc
2 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ outputs:
- name: Stop and disable iscsid service - name: Stop and disable iscsid service
tags: step2 tags: step2
service: name=iscsid state=stopped enabled=no service: name=iscsid state=stopped enabled=no
when: stat_iscsid_service.stat.exists when: (stat_iscsid_service.stat|default('')).exists|default(false)
- name: stat /lib/systemd/system/iscsid.socket - name: stat /lib/systemd/system/iscsid.socket
tags: step2 tags: step2
stat: path=/lib/systemd/system/iscsid.socket stat: path=/lib/systemd/system/iscsid.socket
@ -117,4 +117,4 @@ outputs:
- name: Stop and disable iscsid.socket service - name: Stop and disable iscsid.socket service
tags: step2 tags: step2
service: name=iscsid.socket state=stopped enabled=no service: name=iscsid.socket state=stopped enabled=no
when: stat_iscsid_socket.stat.exists when: (stat_iscsid_socket.stat|default('')).exists|default(false)

View File

@ -179,6 +179,6 @@ outputs:
with_items: with_items:
- "{{ovs_list_of_rpms.stdout_lines}}" - "{{ovs_list_of_rpms.stdout_lines}}"
tags: step2 tags: step2
when: "'2.5.0-14' in '{{ovs_version.stdout}}' when: "'2.5.0-14' in ovs_version.stdout|default('')
or or
ovs_packaging_issue|succeeded" ovs_packaging_issue|default(false)|succeeded"