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 %} diff --git a/environments/site/tofu/control.tf b/environments/site/tofu/control.tf index 7bfa13f61..87da2f784 100644 --- a/environments/site/tofu/control.tf +++ b/environments/site/tofu/control.tf @@ -34,6 +34,13 @@ resource "openstack_networking_port_v2" "control" { binding { vnic_type = lookup(var.vnic_types, each.key, "normal") } + + lifecycle { + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] + } } 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..4d874d1d4 100644 --- a/environments/site/tofu/node_group/nodes.tf +++ b/environments/site/tofu/node_group/nodes.tf @@ -71,6 +71,13 @@ resource "openstack_networking_port_v2" "compute" { binding { vnic_type = lookup(var.vnic_types, each.value.net.network, "normal") } + + lifecycle { + ignore_changes = [ + binding, # fixes running as admin + extra_dhcp_option # required for networking-mlnx neutron plugin + ] + } } resource "openstack_compute_instance_v2" "compute_fixed_image" {