Skip to content

Commit 0da4041

Browse files
authored
Ignore changes to port binding and dhcp options (#778)
* ignore port binding info; fixes tf when admin * ignore port dhcp changes to fix networking-mlxn * ignore port binding/dhcp options for caas * fix TF linter errors
1 parent eb1fb2d commit 0da4041

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

ansible/roles/cluster_infra/templates/resources.tf.j2

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,14 @@ resource "openstack_networking_port_v2" "login" {
219219
binding {
220220
vnic_type = "{{ cluster_vnic_type | default('normal') }}"
221221
}
222+
223+
lifecycle {
224+
ignore_changes = [
225+
binding, # fixes running as admin
226+
extra_dhcp_option # required for networking-mlnx neutron plugin
227+
]
228+
}
229+
222230
}
223231

224232
# Storage network
@@ -235,6 +243,14 @@ resource "openstack_networking_port_v2" "login_storage" {
235243
binding {
236244
vnic_type = "{{ cluster_storage_vnic_type | default('normal') }}"
237245
}
246+
247+
lifecycle {
248+
ignore_changes = [
249+
binding, # fixes running as admin
250+
extra_dhcp_option # required for networking-mlnx neutron plugin
251+
]
252+
}
253+
238254
}
239255
{% endif %}
240256

@@ -258,8 +274,15 @@ resource "openstack_networking_port_v2" "control" {
258274

259275
binding {
260276
vnic_type = "{{ cluster_vnic_type | default('normal') }}"
277+
}
261278

279+
lifecycle {
280+
ignore_changes = [
281+
binding, # fixes running as admin
282+
extra_dhcp_option # required for networking-mlnx neutron plugin
283+
]
262284
}
285+
263286
}
264287

265288
# Storage network
@@ -276,6 +299,14 @@ resource "openstack_networking_port_v2" "control_storage" {
276299
binding {
277300
vnic_type = "{{ cluster_storage_vnic_type | default('normal') }}"
278301
}
302+
303+
lifecycle {
304+
ignore_changes = [
305+
binding, # fixes running as admin
306+
extra_dhcp_option # required for networking-mlnx neutron plugin
307+
]
308+
}
309+
279310
}
280311
{% endif %}
281312

@@ -301,6 +332,14 @@ resource "openstack_networking_port_v2" "{{ nodegroup.name }}" {
301332
binding {
302333
vnic_type = "{{ cluster_vnic_type | default('normal') }}"
303334
}
335+
336+
lifecycle {
337+
ignore_changes = [
338+
binding, # fixes running as admin
339+
extra_dhcp_option # required for networking-mlnx neutron plugin
340+
]
341+
}
342+
304343
}
305344

306345
# Storage network
@@ -318,6 +357,14 @@ resource "openstack_networking_port_v2" "{{ nodegroup.name }}_storage" {
318357
binding {
319358
vnic_type = "{{ cluster_storage_vnic_type | default('normal') }}"
320359
}
360+
361+
lifecycle {
362+
ignore_changes = [
363+
binding, # fixes running as admin
364+
extra_dhcp_option # required for networking-mlnx neutron plugin
365+
]
366+
}
367+
321368
}
322369
{% endif %}
323370

environments/site/tofu/control.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ resource "openstack_networking_port_v2" "control" {
3434
binding {
3535
vnic_type = lookup(var.vnic_types, each.key, "normal")
3636
}
37+
38+
lifecycle {
39+
ignore_changes = [
40+
binding, # fixes running as admin
41+
extra_dhcp_option # required for networking-mlnx neutron plugin
42+
]
43+
}
3744
}
3845

3946
resource "openstack_compute_instance_v2" "control" {

environments/site/tofu/node_group/nodes.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ resource "openstack_networking_port_v2" "compute" {
7171
binding {
7272
vnic_type = lookup(var.vnic_types, each.value.net.network, "normal")
7373
}
74+
75+
lifecycle {
76+
ignore_changes = [
77+
binding, # fixes running as admin
78+
extra_dhcp_option # required for networking-mlnx neutron plugin
79+
]
80+
}
7481
}
7582

7683
resource "openstack_compute_instance_v2" "compute_fixed_image" {

0 commit comments

Comments
 (0)