kolla-ansible/ansible/roles/octavia/tasks/get_resources_info.yml
Michal Nasiadka c0d0866785 octavia: Fix hm-interface after bumping openstack collection
New openstack collection modules have changed output
dicts/variable names - adapting to that.

Also changing octavia amphora image to focal, since bionic
hasn't been rebuilt since May 2021.

Closes-Bug: #2012255
Change-Id: Icf38a52472d02ef7d69bcd3716afb16e859d44a2
2023-04-26 13:13:31 +00:00

76 lines
2.4 KiB
YAML

---
- name: Get amphora flavor info
become: true
kolla_toolbox:
container_engine: "{{ kolla_container_engine }}"
module_name: os_flavor_info
module_args:
auth: "{{ octavia_user_auth }}"
cacert: "{{ openstack_cacert }}"
endpoint_type: "{{ openstack_interface }}"
region_name: "{{ openstack_region_name }}"
name: "{{ octavia_amp_flavor.name }}"
run_once: True
check_mode: false
delegate_to: "{{ groups['octavia-api'][0] }}"
register: flavor_results
- name: Get {{ octavia_service_auth_project }} project id
become: True
kolla_toolbox:
container_engine: "{{ kolla_container_engine }}"
module_name: os_project_info
module_args:
auth: "{{ octavia_user_auth }}"
cacert: "{{ openstack_cacert }}"
endpoint_type: "{{ openstack_interface }}"
region_name: "{{ openstack_region_name }}"
name: "{{ octavia_service_auth_project }}"
run_once: True
delegate_to: "{{ groups['octavia-api'][0] }}"
check_mode: false
register: project_info
# NOTE(wuchunyang): ansible doesn't have a module to query security groups
# let's use os_security_group module instead.
- name: Get security groups for octavia
become: true
kolla_toolbox:
container_engine: "{{ kolla_container_engine }}"
module_name: os_security_group
module_args:
auth: "{{ octavia_user_auth }}"
cacert: "{{ openstack_cacert }}"
endpoint_type: "{{ openstack_interface }}"
region_name: "{{ openstack_region_name }}"
state: present
name: "{{ item.name }}"
loop: "{{ octavia_amp_security_groups.values() | list }}"
loop_control:
label: "{{ item.name }}"
run_once: True
delegate_to: "{{ groups['octavia-api'][0] }}"
check_mode: false
register: sec_grp_info
- name: Get loadbalancer management network
become: true
kolla_toolbox:
container_engine: "{{ kolla_container_engine }}"
module_name: os_networks_info
module_args:
auth: "{{ octavia_user_auth }}"
cacert: "{{ openstack_cacert }}"
endpoint_type: "{{ openstack_interface }}"
region_name: "{{ openstack_region_name }}"
name: "{{ octavia_amp_network['name'] }}"
register: network_results
run_once: True
delegate_to: "{{ groups['octavia-api'][0] }}"
check_mode: false
- name: Set octavia resources facts
set_fact:
network_info: "{{ network_results.networks | first }}"
amphora_flavor_info: "{{ flavor_results.flavors | first }}"