Skip to content
Snippets Groups Projects
Commit 41c1730d authored by Ryan Randles Jones's avatar Ryan Randles Jones
Browse files

Update main.tf

parent 4d1e4d09
No related branches found
No related tags found
No related merge requests found
# creates public and private keypair
resource "openstack_compute_keypair_v2" "test-keypair" {
name = "my-keypair"
}
# defines where floating ip will come from using variable from vars.tf
resource "openstack_networking_floatingip_v2" "ohpc" {
......@@ -10,7 +14,7 @@ resource "openstack_compute_instance_v2" "ohpc" {
name = "ohpc"
image_name = "${var.image}"
flavor_name = "${var.flavor}"
key_pair = "${var.key_pair}"
key_pair = "${openstack_compute_keypair_v2.test-keypair.name}"
security_groups = ["default"]
# defines the networks of the instance
......@@ -67,20 +71,3 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
}
}
# creates details for the instance using variables defined in vars.tf
resource "openstack_compute_instance_v2" "ohpc" {
name = "ohpc"
image_name = "${var.image}"
flavor_name = "${var.flavor}"
key_pair = "${var.key_pair}"
security_groups = ["default"]
# defines the networks of the instance
network {
name = "dmznet"
}
network {
name = "clusternet"
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment