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

using pub and private key info from datasources

parent 862fcd2e
No related branches found
No related tags found
1 merge request!18Variable update branch
resource "openstack_compute_keypair_v2" "keypair" {
name = "${var.os-gen-keypair}"
public_key = "${var.public-key}"
}
#local variable for ssh connect to ohpc #local variable for ssh connect to ohpc
locals { locals {
...@@ -67,7 +63,7 @@ depends_on = ["openstack_networking_subnet_v2.dmzsubnet"] ...@@ -67,7 +63,7 @@ depends_on = ["openstack_networking_subnet_v2.dmzsubnet"]
name = "ohpc" name = "ohpc"
image_name = "${var.image}" image_name = "${var.image}"
flavor_name = "${var.flavor}" flavor_name = "${var.flavor}"
key_pair = "${openstack_compute_keypair_v2.keypair.name}" key_pair = "${data.openstack_compute_keypair_v2.keypair.name}"
security_groups = ["default"] security_groups = ["default"]
# defines the networks of the instance # defines the networks of the instance
...@@ -88,7 +84,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" { ...@@ -88,7 +84,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" {
connection { connection {
host = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}" host = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}"
user = "centos" user = "centos"
private_key = "${file("~/.ssh/id_rsa")}" private_key = "${data.openstack_compute_keypair_v2.keypair.private_key}"
} }
inline = [ inline = [
......
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