Skip to content

Allow use of Ironic node name as instance name #630

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module "compute" {
ignore_image_changes = lookup(each.value, "ignore_image_changes", false)
match_ironic_node = lookup(each.value, "match_ironic_node", false)
availability_zone = lookup(each.value, "availability_zone", "nova")
use_ironic_node_name = lookup(each.value, "use_ironic_node_name", false)

# computed
# not using openstack_compute_instance_v2.control.access_ip_v4 to avoid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {

for_each = var.ignore_image_changes ? toset(var.nodes) : []

name = "${var.cluster_name}-${each.key}"
name = var.use_ironic_node_name ? "${each.key}" : "${var.cluster_name}-${each.key}"
image_id = var.image_id
flavor_name = var.flavor
key_pair = var.key_pair
Expand Down Expand Up @@ -111,7 +111,7 @@ resource "openstack_compute_instance_v2" "compute" {

for_each = var.ignore_image_changes ? [] : toset(var.nodes)

name = "${var.cluster_name}-${each.key}"
name = var.use_ironic_node_name ? "${each.key}" : "${var.cluster_name}-${each.key}"
image_id = var.image_id
flavor_name = var.flavor
key_pair = var.key_pair
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ variable "match_ironic_node" {
default = false
}

variable "use_ironic_node_name" {
type = bool
description = "Whether to name instances the same as the matching Ironic node (no cluster name)"
default = false
}

variable "availability_zone" {
type = string
description = "Name of availability zone - ignored unless match_ironic_node is true"
Expand Down
Loading