Fix warning on {failed|changed}_when statements

Ansible 2.3.0 does not like delimiters in when statement.

Related link: https://github.com/ansible/ansible/issues/22397

Closes-Bug: #1714349
Change-Id: I973cc6537c4c1374546b5cddb4ce713a553b92f4
This commit is contained in:
Bertrand Lallau 2017-08-31 22:15:32 +02:00
parent 9a520e0906
commit 191e268575
5 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@
--os-project-name={{ openstack_auth.project_name }} \
secret get -f value -p {{ barbican_store_secret.stdout }}
register: barbican_get_secret
failed_when: "{{ barbican_get_secret.stdout != 'kolla' }}"
failed_when: barbican_get_secret.stdout != 'kolla'
run_once: True
when: kolla_enable_sanity_barbican | bool

View File

@ -4,7 +4,7 @@
-m find_disks
-a "partition_name='KOLLA_CEPH_OSD_BOOTSTRAP' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}"
register: osd_lookup
changed_when: "{{ osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
changed_when: osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
failed_when: osd_lookup.stdout.split()[2] != 'SUCCESS'
- name: Parsing disk info for Ceph OSDs

View File

@ -14,7 +14,7 @@
-m find_disks
-a "partition_name='KOLLA_CEPH_DATA' match_mode='prefix' use_udev={{ kolla_ceph_use_udev }}"
register: osd_lookup
changed_when: "{{ osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
changed_when: osd_lookup.stdout.find('localhost | SUCCESS => ') != -1 and (osd_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
failed_when: osd_lookup.stdout.split()[2] != 'SUCCESS'
when: inventory_hostname in groups['ceph-osd']

View File

@ -11,7 +11,7 @@
auth={{ '{{ openstack_swift_auth }}' }}"
-e "{'openstack_swift_auth':{{ openstack_swift_auth }}}"
register: swift_sanity
changed_when: "{{ swift_sanity.stdout.find('localhost | SUCCESS => ') != -1 and (swift_sanity.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
changed_when: swift_sanity.stdout.find('localhost | SUCCESS => ') != -1 and (swift_sanity.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
until: swift_sanity.stdout.split()[2] == 'SUCCESS'
retries: 10
delay: 5

View File

@ -5,8 +5,8 @@
-a "name={{ swift_devices_name }}
match_mode={{ swift_devices_match_mode }}"
register: swift_disk_lookup
changed_when: "{{ swift_disk_lookup.stdout.find('localhost | SUCCESS => ') != -1 and
(swift_disk_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
changed_when: swift_disk_lookup.stdout.find('localhost | SUCCESS => ') != -1 and
(swift_disk_lookup.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed
failed_when: swift_disk_lookup.stdout.split()[2] != 'SUCCESS'
when: inventory_hostname in groups['swift-account-server'] or
inventory_hostname in groups['swift-container-server'] or