From c0d08667852cbed51cda68ca3935e2a52686a168 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Wed, 22 Mar 2023 12:25:05 +0100 Subject: [PATCH] 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 --- ansible/roles/octavia/tasks/get_resources_info.yml | 4 ++-- ansible/roles/octavia/tasks/hm-interface.yml | 4 ++-- ansible/roles/octavia/templates/octavia.conf.j2 | 4 ++-- tests/test-octavia.sh | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ansible/roles/octavia/tasks/get_resources_info.yml b/ansible/roles/octavia/tasks/get_resources_info.yml index 21571d59b8..1576ea8b8d 100644 --- a/ansible/roles/octavia/tasks/get_resources_info.yml +++ b/ansible/roles/octavia/tasks/get_resources_info.yml @@ -71,5 +71,5 @@ - name: Set octavia resources facts set_fact: - network_info: "{{ network_results.openstack_networks.0 }}" - amphora_flavor_info: "{{ flavor_results.openstack_flavors.0 }}" + network_info: "{{ network_results.networks | first }}" + amphora_flavor_info: "{{ flavor_results.flavors | first }}" diff --git a/ansible/roles/octavia/tasks/hm-interface.yml b/ansible/roles/octavia/tasks/hm-interface.yml index f7dcab702c..3af55b15ec 100644 --- a/ansible/roles/octavia/tasks/hm-interface.yml +++ b/ansible/roles/octavia/tasks/hm-interface.yml @@ -22,7 +22,7 @@ - name: Update Octavia health manager port host_id become: True vars: - port_id: "{{ port_info.id }}" + port_id: "{{ port_info.port.id }}" command: > {{ kolla_container_engine }} exec kolla_toolbox openstack --os-interface {{ openstack_interface }} @@ -41,7 +41,7 @@ - name: Add Octavia port to openvswitch br-int vars: port_mac: "{{ port_info.port.mac_address }}" - port_id: "{{ port_info.id }}" + port_id: "{{ port_info.port.id }}" become: True command: > {{ kolla_container_engine }} exec openvswitch_vswitchd ovs-vsctl --may-exist \ diff --git a/ansible/roles/octavia/templates/octavia.conf.j2 b/ansible/roles/octavia/templates/octavia.conf.j2 index 5f43fde038..9d1fbc7cf3 100644 --- a/ansible/roles/octavia/templates/octavia.conf.j2 +++ b/ansible/roles/octavia/templates/octavia.conf.j2 @@ -101,9 +101,9 @@ amp_secgroup_list = {{ octavia_amp_secgroup_list }} amp_flavor_id = {{ octavia_amp_flavor_id }} {% endif %} {% else %} -amp_image_owner_id = {{ project_info.openstack_projects.0.id }} +amp_image_owner_id = {{ project_info.projects.0.id }} amp_boot_network_list = {{ network_info.id }} -amp_secgroup_list = {{ (sec_grp_info.results | selectattr('item.name', 'equalto', octavia_amp_security_groups['mgmt-sec-grp'].name) | list).0.secgroup.id }} +amp_secgroup_list = {{ (sec_grp_info.results | selectattr('item.name', 'equalto', octavia_amp_security_groups['mgmt-sec-grp'].name) | list).0.security_group.id }} amp_flavor_id = {{ amphora_flavor_info.id }} {% endif %} diff --git a/tests/test-octavia.sh b/tests/test-octavia.sh index 758d38043b..4ba3457a2d 100644 --- a/tests/test-octavia.sh +++ b/tests/test-octavia.sh @@ -10,7 +10,7 @@ export PYTHONUNBUFFERED=1 function register_amphora_image { - amphora_url=https://tarballs.opendev.org/openstack/octavia/test-images/test-only-amphora-x64-haproxy-ubuntu-bionic.qcow2 + amphora_url=https://tarballs.opendev.org/openstack/octavia/test-images/test-only-amphora-x64-haproxy-ubuntu-focal.qcow2 curl -o amphora.qcow2 $amphora_url (. /etc/kolla/octavia-openrc.sh && openstack image create amphora-x64-haproxy --file amphora.qcow2 --tag amphora --disk-format qcow2 --property hw_architecture='x86_64' --property hw_rng_model=virtio) }