Skip to content

Commit 84513a6

Browse files
committed
OpenStack: Fix dualstack with external load-balancer
When the cluster is created with an external load-balancer, no api or ingress VIP Ports exists, but for dual-stack installations we are expecting those Ports to pre-exists, resulting in failure to add security groups to those Ports. This commit fixes the issue by ensuring to only attach the security group when no external lb is configured and dual-stack is used.
1 parent 2bdbd5d commit 84513a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

data/data/openstack/masters/private-network.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ data "openstack_networking_port_ids_v2" "ingress_ports" {
103103
}
104104

105105
resource "openstack_networking_port_secgroup_associate_v2" "api_port_sg" {
106-
count = var.use_ipv6 ? 1 : 0
106+
count = (! var.openstack_user_managed_load_balancer && var.use_ipv6) ? 1 : 0
107107
port_id = data.openstack_networking_port_ids_v2.api_ports.ids[0]
108108
security_group_ids = [openstack_networking_secgroup_v2.master.id]
109109
depends_on = [data.openstack_networking_port_ids_v2.api_ports]
110110
}
111111

112112
resource "openstack_networking_port_secgroup_associate_v2" "ingress_port_sg" {
113-
count = var.use_ipv6 ? 1 : 0
113+
count = (! var.openstack_user_managed_load_balancer && var.use_ipv6) ? 1 : 0
114114
port_id = data.openstack_networking_port_ids_v2.ingress_ports.ids[0]
115115
security_group_ids = [openstack_networking_secgroup_v2.worker.id]
116116
depends_on = [data.openstack_networking_port_ids_v2.ingress_ports]

0 commit comments

Comments
 (0)