From a084f1cc73ee6eb1d592aa3db54f847efe982004 Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Wed, 10 Sep 2025 14:16:33 +0000 Subject: [PATCH 1/4] ignore port binding info; fixes tf when admin --- environments/site/tofu/control.tf | 4 ++++ environments/site/tofu/node_group/nodes.tf | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/environments/site/tofu/control.tf b/environments/site/tofu/control.tf index 7bfa13f61..cb13c855f 100644 --- a/environments/site/tofu/control.tf +++ b/environments/site/tofu/control.tf @@ -34,6 +34,10 @@ resource "openstack_networking_port_v2" "control" { binding { vnic_type = lookup(var.vnic_types, each.key, "normal") } + + lifecycle { + ignore_changes = [ binding ] + } } resource "openstack_compute_instance_v2" "control" { diff --git a/environments/site/tofu/node_group/nodes.tf b/environments/site/tofu/node_group/nodes.tf index d02028f2f..4738214a0 100644 --- a/environments/site/tofu/node_group/nodes.tf +++ b/environments/site/tofu/node_group/nodes.tf @@ -71,6 +71,10 @@ resource "openstack_networking_port_v2" "compute" { binding { vnic_type = lookup(var.vnic_types, each.value.net.network, "normal") } + + lifecycle { + ignore_changes = [ binding ] + } } resource "openstack_compute_instance_v2" "compute_fixed_image" { From a2b04f3d7be55b509716ffa2009db6a6cae5772b Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Tue, 16 Sep 2025 07:56:21 +0000 Subject: [PATCH 2/4] ignore port dhcp changes to fix networking-mlxn --- environments/site/tofu/control.tf | 5 ++++- environments/site/tofu/node_group/nodes.tf | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/environments/site/tofu/control.tf b/environments/site/tofu/control.tf index cb13c855f..f55243923 100644 --- a/environments/site/tofu/control.tf +++ b/environments/site/tofu/control.tf @@ -36,7 +36,10 @@ resource "openstack_networking_port_v2" "control" { } lifecycle { - ignore_changes = [ binding ] + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] } } diff --git a/environments/site/tofu/node_group/nodes.tf b/environments/site/tofu/node_group/nodes.tf index 4738214a0..523247d99 100644 --- a/environments/site/tofu/node_group/nodes.tf +++ b/environments/site/tofu/node_group/nodes.tf @@ -73,7 +73,10 @@ resource "openstack_networking_port_v2" "compute" { } lifecycle { - ignore_changes = [ binding ] + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] } } From d653f2c7ff74f4776139e556701183be0cd57b91 Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Wed, 17 Sep 2025 07:48:27 +0000 Subject: [PATCH 3/4] ignore port binding/dhcp options for caas --- .../cluster_infra/templates/resources.tf.j2 | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/ansible/roles/cluster_infra/templates/resources.tf.j2 b/ansible/roles/cluster_infra/templates/resources.tf.j2 index f3423712e..f46192c1f 100644 --- a/ansible/roles/cluster_infra/templates/resources.tf.j2 +++ b/ansible/roles/cluster_infra/templates/resources.tf.j2 @@ -219,6 +219,14 @@ resource "openstack_networking_port_v2" "login" { binding { vnic_type = "{{ cluster_vnic_type | default('normal') }}" } + + lifecycle { + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] + } + } # Storage network @@ -235,6 +243,14 @@ resource "openstack_networking_port_v2" "login_storage" { binding { vnic_type = "{{ cluster_storage_vnic_type | default('normal') }}" } + + lifecycle { + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] + } + } {% endif %} @@ -258,8 +274,15 @@ resource "openstack_networking_port_v2" "control" { binding { vnic_type = "{{ cluster_vnic_type | default('normal') }}" + } + lifecycle { + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] } + } # Storage network @@ -276,6 +299,14 @@ resource "openstack_networking_port_v2" "control_storage" { binding { vnic_type = "{{ cluster_storage_vnic_type | default('normal') }}" } + + lifecycle { + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] + } + } {% endif %} @@ -301,6 +332,14 @@ resource "openstack_networking_port_v2" "{{ nodegroup.name }}" { binding { vnic_type = "{{ cluster_vnic_type | default('normal') }}" } + + lifecycle { + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] + } + } # Storage network @@ -318,6 +357,14 @@ resource "openstack_networking_port_v2" "{{ nodegroup.name }}_storage" { binding { vnic_type = "{{ cluster_storage_vnic_type | default('normal') }}" } + + lifecycle { + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] + } + } {% endif %} From c77569b49fcab0943ef8624cd6258a22e1af0024 Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Thu, 18 Sep 2025 16:08:24 +0000 Subject: [PATCH 4/4] fix TF linter errors --- environments/site/tofu/control.tf | 2 +- environments/site/tofu/node_group/nodes.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environments/site/tofu/control.tf b/environments/site/tofu/control.tf index f55243923..87da2f784 100644 --- a/environments/site/tofu/control.tf +++ b/environments/site/tofu/control.tf @@ -37,7 +37,7 @@ resource "openstack_networking_port_v2" "control" { lifecycle { ignore_changes = [ - binding, # fixes running as admin + binding, # fixes running as admin extra_dhcp_option # required for networking-mlnx neutron plugin ] } diff --git a/environments/site/tofu/node_group/nodes.tf b/environments/site/tofu/node_group/nodes.tf index 523247d99..4d874d1d4 100644 --- a/environments/site/tofu/node_group/nodes.tf +++ b/environments/site/tofu/node_group/nodes.tf @@ -74,7 +74,7 @@ resource "openstack_networking_port_v2" "compute" { lifecycle { ignore_changes = [ - binding, # fixes running as admin + binding, # fixes running as admin extra_dhcp_option # required for networking-mlnx neutron plugin ] }