Fixes for Ansible 2.10

os_image_facts renamed to os_image_info, and no longer sets a fact.
Instead we use the registered result. The same is true for
os_networks_facts and os_networks_info.

We did not catch the networks issue in CI because the code only runs
with a VLAN provisioning network, and we use a flat network.

Change-Id: I6a801e8bb5171bebd2b3f20d6140329d38ea36a5
This commit is contained in:
Mark Goddard 2021-05-10 10:53:48 +01:00 committed by Pierre Riteau
parent 9c0bec4d3c
commit c44f4815cf
2 changed files with 7 additions and 7 deletions

View File

@ -89,7 +89,7 @@
- block: - block:
- name: Gather facts about provisioning network - name: Gather facts about provisioning network
os_networks_facts: os_networks_info:
auth: "{{ openstack_auth }}" auth: "{{ openstack_auth }}"
auth_type: "{{ openstack_auth_type }}" auth_type: "{{ openstack_auth_type }}"
cacert: "{{ openstack_cacert | default(omit, true) }}" cacert: "{{ openstack_cacert | default(omit, true) }}"
@ -100,7 +100,7 @@
- name: Set provisioning network to unshared - name: Set provisioning network to unshared
command: "{{ venv }}/bin/openstack network set {{ provision_net.name }} --no-share" command: "{{ venv }}/bin/openstack network set {{ provision_net.name }} --no-share"
changed_when: true changed_when: true
when: openstack_networks[0].shared when: provisioning_network_facts.openstack_networks[0].shared
environment: "{{ openstack_auth_env }}" environment: "{{ openstack_auth_env }}"
vars: vars:
ansible_python_interpreter: "{{ venv }}/bin/python" ansible_python_interpreter: "{{ venv }}/bin/python"
@ -108,7 +108,7 @@
- block: - block:
- name: Gather facts about cleaning network - name: Gather facts about cleaning network
os_networks_facts: os_networks_info:
auth: "{{ openstack_auth }}" auth: "{{ openstack_auth }}"
auth_type: "{{ openstack_auth_type }}" auth_type: "{{ openstack_auth_type }}"
cacert: "{{ openstack_cacert | default(omit, true) }}" cacert: "{{ openstack_cacert | default(omit, true) }}"
@ -119,7 +119,7 @@
- name: Set cleaning network to unshared - name: Set cleaning network to unshared
command: "{{ venv }}/bin/openstack network set {{ cleaning_net.name }} --no-share" command: "{{ venv }}/bin/openstack network set {{ cleaning_net.name }} --no-share"
changed_when: true changed_when: true
when: openstack_networks[0].shared when: cleaning_network_facts.openstack_networks[0].shared
environment: "{{ openstack_auth_env }}" environment: "{{ openstack_auth_env }}"
vars: vars:
ansible_python_interpreter: "{{ venv }}/bin/python" ansible_python_interpreter: "{{ venv }}/bin/python"

View File

@ -1,7 +1,7 @@
--- ---
- name: Retrieve deployment image uuids - name: Retrieve deployment image uuids
os_image_facts: os_image_info:
auth_type: "{{ ipa_images_openstack_auth_type }}" auth_type: "{{ ipa_images_openstack_auth_type }}"
auth: "{{ ipa_images_openstack_auth }}" auth: "{{ ipa_images_openstack_auth }}"
cacert: "{{ ipa_images_openstack_cacert | default(omit, true) }}" cacert: "{{ ipa_images_openstack_cacert | default(omit, true) }}"
@ -14,11 +14,11 @@
- name: Set fact containing kernel uuid - name: Set fact containing kernel uuid
set_fact: set_fact:
ipa_images_kernel_uuid: "{{ ipa_images_glance.results[0].ansible_facts.openstack_image.id }}" ipa_images_kernel_uuid: "{{ ipa_images_glance.results[0].openstack_image.id }}"
- name: Set fact containing ramdisk uuid - name: Set fact containing ramdisk uuid
set_fact: set_fact:
ipa_images_ramdisk_uuid: "{{ ipa_images_glance.results[1].ansible_facts.openstack_image.id }}" ipa_images_ramdisk_uuid: "{{ ipa_images_glance.results[1].openstack_image.id }}"
- name: Get a list of ironic nodes - name: Get a list of ironic nodes
command: | command: |