Skip to content

Support fixed IP addresses for control node #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/production.md
Original file line number Diff line number Diff line change
@@ -109,13 +109,13 @@ and referenced from the `site` and `production` environments, e.g.:
resource "openstack_networking_port_v2" "control" {
...
fixed_ip {
subnet_id = data.openstack_networking_subnet_v2.cluster_subnet.id
ip_address = var.control_ip_address
subnet_id = data.openstack_networking_subnet_v2.cluster_subnet.id
ip_address = (var.control_ip_addresses != {})? var.control_ip_addresses[each.key]: null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ip_address = (var.control_ip_addresses != {})? var.control_ip_addresses[each.key]: null
ip_address = (var.control_ip_addresses != {}) ? var.control_ip_addresses[each.key] : null

just makes the ternary clearer

}
}
```

Note the variable `control_ip_address` is new.
Note the variable `control_ip_addresses` is new.

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

Original file line number Diff line number Diff line change
@@ -11,7 +11,8 @@ resource "openstack_networking_port_v2" "control" {
admin_state_up = "true"

fixed_ip {
subnet_id = data.openstack_networking_subnet_v2.cluster_subnet[each.key].id
subnet_id = data.openstack_networking_subnet_v2.cluster_subnet[each.key].id
ip_address = (var.control_ip_addresses != {})? var.control_ip_addresses[each.key]: null
}

no_security_groups = lookup(each.value, "no_security_groups", false)
Original file line number Diff line number Diff line change
@@ -24,6 +24,12 @@ variable "key_pair" {
description = "Name of an existing keypair in OpenStack"
}

variable "control_ip_addresses" {
type = map(string)
description = "Mapping of networks to fixed IP addresses used by control node"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "Mapping of networks to fixed IP addresses used by control node"
description = "Mapping of fixed IP addresses for control node, keyed by network name"

default = {}
}

variable "control_node_flavor" {
type = string
description = "Flavor name for control node"
Loading