From 1c4409735d3c2d21ca9dea29798d5e1f5747c59f Mon Sep 17 00:00:00 2001 From: Stig Telfer Date: Tue, 28 Nov 2023 21:55:32 +0000 Subject: [PATCH] Fix gateway assignment when seed SNAT is disabled Fix a logic issue when seed SNAT is not enabled. In this circumstance Bifrost was generating ConfigDrive data with the default gateway unset even when one is available on the admin network. This regression was introduced in Ib847d3420dee374cec067cd8af519b510be04120 [1]. [1] https://review.opendev.org/c/openstack/kayobe/+/898434 Closes-Bug: #2045926 Change-Id: Ifd9f9cd389ac09448fc91dba74f8f09595698b55 (cherry picked from commit 49f91043c6c3b0549a8625baba1e6e218eb69160) --- ansible/kolla-bifrost-hostvars.yml | 2 +- .../notes/fix-bifrost-gateway-b4bc8a0396dfa935.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-bifrost-gateway-b4bc8a0396dfa935.yaml diff --git a/ansible/kolla-bifrost-hostvars.yml b/ansible/kolla-bifrost-hostvars.yml index bb0ca2539..b4ab4fb48 100644 --- a/ansible/kolla-bifrost-hostvars.yml +++ b/ansible/kolla-bifrost-hostvars.yml @@ -22,7 +22,7 @@ # If the admin network does not have a gateway defined and seed SNAT is # enabled, use the seed as a gateway to allow external access until other # networks have been configured. Otherwise, do not set any gateway. - ipv4_gateway: "{{ admin_oc_net_name | net_gateway or admin_oc_net_name | net_ip(seed_host) if seed_enable_snat | bool }}" + ipv4_gateway: "{{ (admin_oc_net_name | net_gateway) or (admin_oc_net_name | net_ip(seed_host) if seed_enable_snat | bool) }}" ipv4_nameserver: "{{ resolv_nameservers }}" network_mtu: "{{ admin_oc_net_name | net_mtu or '1500' }}" vlan_id: "{{ '' if admin_oc_net_name == provision_oc_net_name else (admin_oc_net_name | net_vlan) }}" diff --git a/releasenotes/notes/fix-bifrost-gateway-b4bc8a0396dfa935.yaml b/releasenotes/notes/fix-bifrost-gateway-b4bc8a0396dfa935.yaml new file mode 100644 index 000000000..b2075e90a --- /dev/null +++ b/releasenotes/notes/fix-bifrost-gateway-b4bc8a0396dfa935.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes gateway assignment when seed SNAT is disabled. In this circumstance + Bifrost was generating ConfigDrive data with the default gateway unset even + when one is available on the admin network.