Merge "Fix Ansible Using tests as filters is deprecated"

This commit is contained in:
Zuul 2018-08-20 22:11:56 +00:00 committed by Gerrit Code Review
commit 563beae652
9 changed files with 36 additions and 36 deletions

View File

@ -13,7 +13,7 @@
changed_when: false
# If libvirt is not available, we can skip the rest of the tasks.
- when: libvirt_check|success
- when: libvirt_check is success
block:
# Check to see if the networks exist.
@ -30,7 +30,7 @@
- name: Stop libvirt networks
command: >
virsh net-destroy "{{ item.item.name }}"
when: libvirt_check|success and item|success
when: libvirt_check is success and item is success
with_items: "{{ network_check.results }}"
ignore_errors: true
become: true
@ -38,7 +38,7 @@
- name: Undefine libvirt networks
command: >
virsh net-undefine "{{ item.item.name }}"
when: libvirt_check|success and item|success
when: libvirt_check is success and item is success
with_items: "{{ network_check.results }}"
ignore_errors: true
become: true

View File

@ -32,7 +32,7 @@
set_fact:
image_cache_path: "{{ _latest }}"
cacheable: true
when: latest_exists|success and _force_cached_image
when: latest_exists is success and _force_cached_image
# The md5sum for base OS images are not hosted, they are defined in a configuration file.
# Handle base os images slightly differently
@ -63,7 +63,7 @@
# Otherwise, check if there's a new image available.
- when:
- image.md5sum is not defined
- not _force_cached_image or latest_exists|failed
- not _force_cached_image or latest_exists is failed
block:
# Get the expected checksum for the remote image.
@ -96,7 +96,7 @@
# Note.. image_exists and base_image_exists are required variables because
# even unused variables will overwrite each other.
- when: image_exists is defined and (image_exists|failed or base_image_exists|failed)
- when: image_exists is defined and (image_exists is failed or base_image_exists is failed)
block:
# This task will download the image. We're using `curl` here
@ -132,7 +132,7 @@
fail:
msg: image checksum does not match
when: >
image_exists|failed and
image_exists is failed and
(md5_expected != md5_actual)
- name: Cache image by checksum

View File

@ -20,11 +20,11 @@
template:
src: volume_pool.xml.j2
dest: "{{ working_dir }}/volume_pool.xml"
when: pool_check|failed
when: pool_check is failed
- name: Define volume pool
command: "virsh pool-define {{ working_dir }}/volume_pool.xml"
when: pool_check|failed
when: pool_check is failed
environment:
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"

View File

@ -130,7 +130,7 @@
- name: Get libvirt nodepool IP addresses
script: "get-domain-ip.sh subnode-0"
register: "subnode_0_ip_result"
until: "subnode_0_ip_result|success"
until: "subnode_0_ip_result is success"
retries: 20
delay: 10
@ -171,7 +171,7 @@
- name: Get libvirt nodepool IP addresses
script: "get-domain-ip.sh subnode-1"
register: "subnode_1_ip_result"
until: "subnode_1_ip_result|success"
until: "subnode_1_ip_result is success"
retries: 20
delay: 10

View File

@ -39,7 +39,7 @@
'{{ item.item.name }}'.qcow2 '{{ flavors[item.item.flavor].disk }}'G
--format qcow2
when:
- item|failed
- item is failed
- not libvirt_nodepool_vms|default("false")|bool
with_items: "{{ overcloud_vol_check.results }}"
@ -90,7 +90,7 @@
- name: Attach additional blockdevices to overcloud objectstorage VMs
command: >
virsh attach-disk --config {{ item.item[0].name }} {{ libvirt_volume_path }}/{{ item.item[0].name }}_{{ item.item[1] }}.img {{ item.item[1] }}
when: item|failed
when: item is failed
with_items: "{{ overcloud_extradisks_check.results }}"
# Generate the `instackenv.json` configuration file. Note that this

View File

@ -43,7 +43,7 @@
environment:
LIBVIRT_DEFAULT_URI: '{{ libvirt_uri }}'
- when: supplemental_vol_check|failed
- when: supplemental_vol_check is failed
block:
# TODO(hrybacki): Update fetch-images role to handle supplemental images
- name: Fetch centos image for ipa

View File

@ -26,7 +26,7 @@
environment:
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
- when: undercloud_vol_check|failed
- when: undercloud_vol_check is failed
environment:
LIBGUESTFS_BACKEND: direct
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
@ -169,7 +169,7 @@
# Resize the undercloud image if it was not converted from an overcloud
# image
- when:
- undercloud_vol_check|failed
- undercloud_vol_check is failed
- not overcloud_as_undercloud|bool
block:
- name: >
@ -182,7 +182,7 @@
register: undercloud_partitions
- when:
- undercloud_vol_check|failed
- undercloud_vol_check is failed
- not overcloud_as_undercloud|bool
- undercloud_partitions.stdout=='/dev/sda1'
block:
@ -207,7 +207,7 @@
'{{ working_dir }}/undercloud.qcow2'
- when:
- undercloud_vol_check|failed
- undercloud_vol_check is failed
- not overcloud_as_undercloud|bool
- undercloud_partitions.stdout=='/dev/sda'
block:
@ -294,7 +294,7 @@
overcloud_as_undercloud: true
cacheable: true
- when: undercloud_vol_check|failed
- when: undercloud_vol_check is failed
environment:
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
block:
@ -370,7 +370,7 @@
- name: Get undercloud vm ip address
script: "get-undercloud-ip.sh {{ undercloud_node.name }}"
register: undercloud_vm_ip_result
until: undercloud_vm_ip_result|success
until: undercloud_vm_ip_result is success
retries: "{{ undercloud_ip_retries }}"
delay: 10
environment:

View File

@ -17,7 +17,7 @@
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
# If libvirt isn't available we can skip everything else.
- when: libvirt_check|success
- when: libvirt_check is success
environment:
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
block:
@ -37,14 +37,14 @@
- name: Destroy overcloud vms
command:
virsh destroy "{{ item.item.name }}"
when: item|success
when: item is success
with_items: "{{ overcloud_check.results }}"
ignore_errors: true
- name: Undefine overcloud vms
command:
virsh undefine "{{ item.item.name }}"
when: item|success
when: item is success
with_items: "{{ overcloud_check.results }}"
# The `virsh vol-dumpxml ... > /dev/null` is here (and elsewhere) due to
@ -73,13 +73,13 @@
- name: Destroy supplemental vm
command: >
virsh destroy "{{ supplemental_node.name|default('') }}"
when: supplemental_check|success
when: supplemental_check is success
ignore_errors: true
- name: Undefine supplemental vm
command: >
virsh undefine "{{ supplemental_node.name|default('') }}" --remove-all-storage
when: supplemental_check|success
when: supplemental_check is success
ignore_errors: true
# Do the same thing to the undercloud node.
@ -92,13 +92,13 @@
- name: Destroy undercloud vm
command: >
virsh destroy "{{ undercloud_node.name }}"
when: undercloud_check|success
when: undercloud_check is success
ignore_errors: true
- name: Undefine undercloud vm
command: >
virsh undefine "{{ undercloud_node.name }}"
when: undercloud_check|success
when: undercloud_check is success
- name: Delete undercloud vm storage
shell: |
@ -126,28 +126,28 @@
shell: |
virsh pool-dumpxml "{{ libvirt_volume_pool }}" |
virsh pool-define /dev/stdin
when: pool_check|success
when: pool_check is success
- name: Destroy volume pool
command: >
virsh pool-destroy "{{ libvirt_volume_pool }}"
when: pool_check|success
when: pool_check is success
ignore_errors: true
- name: Undefine volume pool
command: >
virsh pool-undefine "{{ libvirt_volume_pool }}"
when: pool_check|success
when: pool_check is success
- name: Get UID of pool user
command: id -u "{{ ansible_user_id }}"
register: pool_uid
changed_when: false
when: pool_check|success
when: pool_check is success
- name: Destroy pool definition file
file:
path: "/run/user/{{ pool_uid.stdout }}/libvirt/storage/run/{{ libvirt_volume_pool }}.xml"
state: absent
when: pool_check|success
when: pool_check is success

View File

@ -7,7 +7,7 @@
changed_when: false
# If the non-root user exists, perform a variety of cleanup tasks.
- when: non_root_uid|success
- when: non_root_uid is success
block:
# Look for and kill any processes owned by the non-root user.
# This will let us remove the user later on.
@ -23,7 +23,7 @@
pkill -u {{ non_root_user }}
ignore_errors: true
become: true
when: proc_exist|success
when: proc_exist is success
- name: Wait for processes to exit
command: >
@ -33,13 +33,13 @@
delay: 3
until: proc_kill.stdout == '0'
ignore_errors: true
when: proc_exist|success
when: proc_exist is success
become: true
- name: Kill (SIGKILL) all processes owned by non-root user
command: >
pkill -9 -u {{ non_root_user }}
when: proc_exist|success
when: proc_exist is success
ignore_errors: true
become: true