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

updated pub and private key info

parent 4b487db4
No related tags found
No related merge requests found
resource "openstack_compute_keypair_v2" "keypair" {
name = "${var.keypair-name}"
public_key = "${var.ssh_public_key}"
}
public_key = "${file(var.ssh_public_key)}"
}
#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("~/.ssh/id_rsa")}"
# }
#}
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_private_key)}"
}
}
# creates dmznet
resource "openstack_networking_network_v2" "dmznet" {
......@@ -88,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 = "${var.ssh_private_key}"
private_key = "${file(var.ssh_private_key)}"
}
inline = [
......@@ -108,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 = "${var.ssh_private_key}"
private_key = "${file(var.ssh_private_key)}"
}
}
......@@ -117,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 = "${var.ssh_private_key}"
private_key = "${file(var.ssh_private_key)}"
}
inline = [
"sudo ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` /CRI_XCBC/site.yaml -b"
......
......@@ -16,18 +16,16 @@ variable "keypair-name" {
variable "ssh_public_key" {
description = "Path to file containing public key"
default =
"~/.ssh/id_rsa.pub"
default = "~/.ssh/id_rsa.pub"
}
variable "ssh_private_key" {
description = "Path to file containing private key"
default =
"~/.ssh/id_rsa"
default = "~/.ssh/id_rsa"
}
variable "enable-dhcp" {
description = "whether dhcp in enabled. defualt is true"
default = true
}
\ No newline at end of file
}
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