Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Adding availability zone to terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Mar 4, 2019
1 parent f6c49a9 commit 6e44244
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions terrafrom/openstack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ resource "openstack_networking_floatingip_v2" "floatingip" {
resource "openstack_compute_instance_v2" "vms" {
count = "${var.vm_nodes * var.environment_count}"
name = "${format("%s-node%02d.%02d.%s", var.prefix, count.index % var.vm_nodes + 1, count.index / var.vm_nodes + 1, var.domain)}"
availability_zone = "${var.openstack_availability_zone}"
image_name = "${var.openstack_instance_image_name}"
flavor_name = "${var.openstack_instance_flavor_name}"
key_pair = "${openstack_compute_keypair_v2.keypair.name}"
Expand Down
5 changes: 5 additions & 0 deletions terrafrom/openstack/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ variable "openstack_auth_url" {
description = "The endpoint url to connect to OpenStack"
}

variable "openstack_availability_zone" {
description = "Availability zone in which to create the server"
default = "nova"
}

variable "openstack_instance_flavor_name" {
description = "Name of flavor in OpenStack"
}
Expand Down

0 comments on commit 6e44244

Please sign in to comment.