Skip to content

Commit b3f0147

Browse files
committed
Support fixed IP addresses for control node
The variable control_ip_address was documented but not implemented. Since we support multiple networks, change it to control_ip_addresses and implement it. Closes #642.
1 parent e0bdcd7 commit b3f0147

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

docs/production.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ and referenced from the `site` and `production` environments, e.g.:
109109
resource "openstack_networking_port_v2" "control" {
110110
...
111111
fixed_ip {
112-
subnet_id = data.openstack_networking_subnet_v2.cluster_subnet.id
113-
ip_address = var.control_ip_address
112+
subnet_id = data.openstack_networking_subnet_v2.cluster_subnet.id
113+
ip_address = (var.control_ip_addresses != {})? var.control_ip_addresses[each.key]: null
114114
}
115115
}
116116
```
117117

118-
Note the variable `control_ip_address` is new.
118+
Note the variable `control_ip_addresses` is new.
119119

120120
Using fixed IPs will require either using admin credentials or policy changes.
121121

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ resource "openstack_networking_port_v2" "control" {
1111
admin_state_up = "true"
1212

1313
fixed_ip {
14-
subnet_id = data.openstack_networking_subnet_v2.cluster_subnet[each.key].id
14+
subnet_id = data.openstack_networking_subnet_v2.cluster_subnet[each.key].id
15+
ip_address = (var.control_ip_addresses != {})? var.control_ip_addresses[each.key]: null
1516
}
1617

1718
no_security_groups = lookup(each.value, "no_security_groups", false)

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

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ variable "key_pair" {
2424
description = "Name of an existing keypair in OpenStack"
2525
}
2626

27+
variable "control_ip_addresses" {
28+
type = map(string)
29+
description = "Mapping of networks to fixed IP addresses used by control node"
30+
default = {}
31+
}
32+
2733
variable "control_node_flavor" {
2834
type = string
2935
description = "Flavor name for control node"

0 commit comments

Comments
 (0)