Use "is failed" instead of "|failed" filter.

According to ansible documentation[1] the filter syntax shouldn't be
used in test since 2.5.

One of the strange outcome I've experienced is ceph update failure was
undetected and the job would end up in timeout.

Fix all the tests still using that idiom to the new one.

[1] https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html#test-syntax

Change-Id: Ibee9655139c0b61ba04417ac39967d1f53793404
(cherry picked from commit dac931018e)
This commit is contained in:
Sofer Athlan-Guyot 2020-03-10 12:26:37 +01:00 committed by Daniel Bengtsson
parent a86c9a2815
commit 2a22df22ae
6 changed files with 10 additions and 10 deletions

View File

@ -13,7 +13,7 @@
source {{ undercloud_rc }}
openstack stack failures list --long {{ overcloud_stack_name }} 2>&1 {{ timestamper_cmd }} | \
tee {{ working_dir }}/ffu_update_stack_outputs_failed.log
when: ffu_stack_output|failed
when: ffu_stack_output is failed
- name: print resource list
shell: |
@ -21,8 +21,8 @@
source {{ undercloud_rc }}
openstack stack resource list --filter status=FAILED --nested-depth 5 {{ overcloud_stack_name }} 2>&1 {{ timestamper_cmd }} | \
tee {{ working_dir }}/ffu_update_stack_outputs_failed_resources.log
when: ffu_stack_output|failed
when: ffu_stack_output is failed
- name: was the ffu update stack outputs successful.
fail: msg="FFU update stack outputs step failed... :("
when: ffu_stack_output|failed
when: ffu_stack_output is failed

View File

@ -24,4 +24,4 @@
- name: was the ffu update ceph successful.
fail: msg="FFU upgrade ceph step failed... :("
when: ffu_upgrade_ceph|failed
when: ffu_upgrade_ceph is failed

View File

@ -13,7 +13,7 @@
source {{ undercloud_rc }}
openstack stack failures list --long {{ overcloud_stack_name }} 2>&1 {{ timestamper_cmd }} | \
tee {{ working_dir }}/ffu_upgrade_converge_failed.log
when: ffu_converge|failed
when: ffu_converge is failed
- name: print resource list
shell: |
@ -21,8 +21,8 @@
source {{ undercloud_rc }}
openstack stack resource list --filter status=FAILED --nested-depth 5 {{ overcloud_stack_name }} \
2>&1 {{ timestamper_cmd }} | tee {{ working_dir }}/ffu_upgrade_converge_failed_resources.log
when: ffu_converge|failed
when: ffu_converge is failed
- name: was the ffu converge successful.
fail: msg="FFU converge step failed... :("
when: ffu_converge|failed
when: ffu_converge is failed

View File

@ -14,4 +14,4 @@
- name: fail Ceph update
fail:
msg: Ceph minor update failed
when: ceph_update_status|failed
when: ceph_update_status is failed

View File

@ -14,4 +14,4 @@
- name: fail Ceph upgrade
fail:
msg: Ceph Upgrade Failed
when: ceph_upg_status|failed
when: ceph_upg_status is failed

View File

@ -97,4 +97,4 @@
scp -q -o StrictHostKeyChecking=no {{ working_dir }}/undercloud.pem {{ oc_user }}@{{ item }}:
ssh -q -o StrictHostKeyChecking=no {{ oc_user }}@{{ item }} 'sudo cp undercloud.pem /etc/pki/ca-trust/source/anchors/; sudo update-ca-trust extract'
loop: "{{ node_ip.stdout_lines }}"
when: uc_keystone_conn|failed
when: uc_keystone_conn is failed