Skip to content

Commit bc62198

Browse files
committed
OpenStack: add support to multiple subnets in the bootstrap
Installations with dual-stack requires the bootstrap node to have one IPv4 and IPv6 Subnet. While the masters already have support for it derived from failure domains work, the bootstrap does not. This commit add support for multiple subnets and ip addresses.
1 parent 105d848 commit bc62198

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)