Skip to content

Commit 22d8d7c

Browse files
Merge pull request openshift#7111 from shiftstack/bootstrap-support-multiple-subnet
OpenStack: add support to multiple subnets in the bootstrap
2 parents ce6a0a1 + bc62198 commit 22d8d7c

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

data/data/openstack/bootstrap/main.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@ resource "openstack_networking_port_v2" "bootstrap_port" {
4848
value = var.cluster_domain
4949
}
5050

51-
fixed_ip {
52-
subnet_id = var.nodes_subnet_id
51+
dynamic "fixed_ip" {
52+
for_each = var.nodes_default_port.fixed_ips
53+
54+
content {
55+
subnet_id = fixed_ip.value["subnet_id"]
56+
ip_address = fixed_ip.value["ip_address"]
57+
}
5358
}
5459

5560
dynamic "allowed_address_pairs" {

data/data/openstack/bootstrap/variables.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ variable "private_network_id" {
77
type = string
88
}
99

10-
variable "nodes_subnet_id" {
11-
type = string
10+
variable "nodes_default_port" {
11+
type = object({
12+
network_id = string
13+
fixed_ips = list(object({
14+
subnet_id = string
15+
ip_address = string
16+
}))
17+
})
1218
}
1319

1420
variable "master_port_ids" {

data/data/openstack/masters/outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ output "private_network_id" {
2121
value = local.nodes_default_port.network_id
2222
}
2323

24-
output "nodes_subnet_id" {
25-
value = local.nodes_default_port.fixed_ips[0].subnet_id
24+
output "nodes_default_port" {
25+
value = local.nodes_default_port
2626
}

0 commit comments

Comments
 (0)