Replace usage of deprecated os_*_facts ansible modules

These are changed to os_*_info modules which return their data
not as facts but via ansible registered variables.

Change-Id: I5a3b2cbcfadeb88f60d9ce2c94cdd949cd0c14ed
This commit is contained in:
Jonathan Rosser 2020-05-14 07:35:26 +01:00
parent dade9a647e
commit d396b68028

View File

@ -20,14 +20,16 @@
ansible_python_interpreter: "{{ trove_service_setup_host_python_interpreter }}"
block:
- name: Get admin tenant id
os_project_facts:
os_project_info:
cloud: default
name: admin
interface: internal
validate_certs: "{{ not (keystone_service_internaluri_insecure | bool) }}"
register: _get_admin_project
- name: Store admin tenant id
set_fact:
keystone_admin_tenant_id: "{{ ansible_facts.openstack_projects[0].id }}"
keystone_admin_tenant_id: "{{ _get_admin_project.openstack_projects[0].id }}"
- name: Create trove service network
os_network:
@ -69,12 +71,13 @@
ansible_python_interpreter: "{{ trove_service_setup_host_python_interpreter }}"
block:
- name: Get trove service net id
os_networks_facts:
os_networks_info:
cloud: default
validate_certs: "{{ trove_service_net_validate_certs }}"
wait: yes
name: "{{ trove_service_net_name }}"
endpoint_type: "{{ trove_service_net_endpoint_type }}"
register: _get_trove_service_net
run_once: true
- name: Fail if trove service network is not available
@ -85,9 +88,9 @@
"to the deployed VMs. This network can be created prior to running this"
" playbook or can be setup by setting trove_service_net_setup to true."
when:
- openstack_networks is not defined or openstack_networks | length == 0
- _get_trove_service_net.openstack_networks is not defined or _get_trove_service_net.openstack_networks | length == 0
- name: Save trove service net id
set_fact:
trove_service_net_id: "{% if openstack_networks is defined %}{{ openstack_networks[0].id }}{% else %}UNKNOWN{% endif %}"
trove_service_net_id: "{{ _get_trove_service_net.openstack_networks[0].id }}"
run_once: true