Skip to content
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

Enable setting per-compute group availability zones #417

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 @@ -26,6 +26,7 @@ resource "openstack_compute_instance_v2" "compute" {
image_id = var.image_id
flavor_name = var.flavor
key_pair = var.key_pair
availability_zone = var.availability_zone_prefix == "" ? null : "${var.availability_zone_prefix}${regex(".*-(.*)$", each.key)[0]}"

dynamic "block_device" {
for_each = var.volume_backed_instances ? [1]: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,9 @@ variable "root_volume_size" {
variable "security_group_ids" {
type = list
}

variable "availability_zone_prefix" {
description = "If non-empty, then the availability_zone is set to this + the last portion of the nodename when split on '-'"
type = string
default = ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ variable "compute" {
image_id: Overrides variable cluster_image_id
vnic_type: Overrides variable vnic_type
vnic_profile: Overrides variable vnic_profile
availability_zone_prefix: If set, use this + last portion of nodename when split on '-' to set availability_zone
EOF
}

Expand Down
Loading