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

Update main.tf

parent 1e57cdb4
No related branches found
No related tags found
No related merge requests found
resource "openstack_compute_keypair_v2" "test-keypair" {
name = "my-keypair"
public_key = "${file("~/.ssh/id_rsa.pub")}"
}
#local variable for ssh connect to ohpc
locals {
connection = {
host = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}"
user = "centos"
private_key = "${file(var.ssh_key)}"
private_key = "${file("~/.ssh/id_rsa")}"
}
}
......@@ -63,7 +67,7 @@ depends_on = ["openstack_networking_subnet_v2.dmzsubnet"]
name = "ohpc"
image_name = "${var.image}"
flavor_name = "${var.flavor}"
key_pair = "${file(var.ssh_key)}"
key_pair = "${openstack_compute_keypair_v2.openstack.key_name}"
security_groups = ["default"]
# defines the networks of the instance
......@@ -84,7 +88,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
connection {
host = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}"
user = "centos"
private_key = "${file(var.ssh_key)}"
private_key = "${file("~/.ssh/id_rsa")}"
}
inline = [
......@@ -104,7 +108,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
host = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}"
#host = "${openstack_networking_floatingip_v2.terraform.address}"
user = "centos"
private_key = "${file(var.ssh_key)}"
private_key = "${file("~/.ssh/id_rsa")}"
}
}
......@@ -113,7 +117,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
host = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}"
#host = "${openstack_networking_floatingip_v2.ohpc.address}"
user = "centos"
private_key = "${file(var.ssh_key)}"
private_key = "${file("~/.ssh/id_rsa")}"
}
inline = [
"sudo ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` /CRI_XCBC/site.yaml -b"
......
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