Skip to content

Commit 9fbc90e

Browse files
committed
support gateway_ip in TF
1 parent 7f8fe79 commit 9fbc90e

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed

environments/skeleton/{{cookiecutter.environment}}/tofu/compute.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module "compute" {
1818
vnic_types = lookup(each.value, "vnic_types", var.vnic_types)
1919
volume_backed_instances = lookup(each.value, "volume_backed_instances", var.volume_backed_instances)
2020
root_volume_size = lookup(each.value, "root_volume_size", var.root_volume_size)
21+
gateway_ip = lookup(each.value, "gateway_ip", var.gateway_ip)
2122

2223
# optionally set for group:
2324
networks = concat(var.cluster_networks, lookup(each.value, "extra_networks", []))

environments/skeleton/{{cookiecutter.environment}}/tofu/control.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ resource "openstack_compute_instance_v2" "control" {
6060
metadata = {
6161
environment_root = var.environment_root
6262
access_ip = openstack_networking_port_v2.control[var.cluster_networks[0].network].all_fixed_ips[0]
63+
gateway_ip = var.gateway_ip
6364
}
6465

6566
user_data = <<-EOF

environments/skeleton/{{cookiecutter.environment}}/tofu/login.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module "login" {
1818
vnic_types = lookup(each.value, "vnic_types", var.vnic_types)
1919
volume_backed_instances = lookup(each.value, "volume_backed_instances", var.volume_backed_instances)
2020
root_volume_size = lookup(each.value, "root_volume_size", var.root_volume_size)
21+
gateway_ip = lookup(each.value, "gateway_ip", var.gateway_ip)
2122

2223
# optionally set for group
2324
networks = concat(var.cluster_networks, lookup(each.value, "extra_networks", []))

environments/skeleton/{{cookiecutter.environment}}/tofu/node_group/nodes.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
8787
environment_root = var.environment_root
8888
control_address = var.control_address
8989
access_ip = openstack_networking_port_v2.compute["${each.key}-${var.networks[0].network}"].all_fixed_ips[0]
90+
gateway_ip = var.gateway_ip
9091
},
9192
{for e in var.compute_init_enable: e => true}
9293
)
@@ -140,6 +141,7 @@ resource "openstack_compute_instance_v2" "compute" {
140141
environment_root = var.environment_root
141142
control_address = var.control_address
142143
access_ip = openstack_networking_port_v2.compute["${each.key}-${var.networks[0].network}"].all_fixed_ips[0]
144+
gateway_ip = var.gateway_ip
143145
},
144146
{for e in var.compute_init_enable: e => true}
145147
)

environments/skeleton/{{cookiecutter.environment}}/tofu/node_group/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,8 @@ variable "baremetal_nodes" {
122122
type = map(string)
123123
default = {}
124124
}
125+
126+
variable "gateway_ip" {
127+
type = string
128+
default = ""
129+
}

environments/skeleton/{{cookiecutter.environment}}/tofu/variables.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ variable "login" {
5858
must already be allocated to the project.
5959
fip_network: Name of network containing ports to attach FIPs to. Only
6060
required if multiple networks are defined.
61-
6261
match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
6362
availability_zone: Name of availability zone - ignored unless match_ironic_node is true (default: "nova")
63+
gateway_ip: Address to add default route via
6464
EOF
6565
}
6666

@@ -96,6 +96,7 @@ variable "compute" {
9696
**NB**: The order in /dev is not guaranteed to match the mapping
9797
match_ironic_node: Set true to launch instances on the Ironic node of the same name as each cluster node
9898
availability_zone: Name of availability zone - ignored unless match_ironic_node is true (default: "nova")
99+
gateway_ip: Address to add default route via
99100
EOF
100101
}
101102

@@ -172,3 +173,9 @@ variable "root_volume_size" {
172173
type = number
173174
default = 40
174175
}
176+
177+
variable "gateway_ip" {
178+
description = "Address to add default route via"
179+
type = string
180+
default = ""
181+
}

0 commit comments

Comments
 (0)