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 branches found
No related tags found
1 merge request!18Variable update branch
resource "openstack_compute_keypair_v2" "keypair" { resource "openstack_compute_keypair_v2" "keypair" {
name = "${var.keypair-name}" name = "${var.keypair-name}"
public_key = "${var.ssh_public_key}" public_key = "${file(var.ssh_public_key)}"
} }
#local variable for ssh connect to ohpc #local variable for ssh connect to ohpc
#locals { locals {
# 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 = "${file(var.ssh_private_key)}"
# } }
#} }
# creates dmznet # creates dmznet
resource "openstack_networking_network_v2" "dmznet" { resource "openstack_networking_network_v2" "dmznet" {
...@@ -88,7 +88,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" { ...@@ -88,7 +88,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 = "${var.ssh_private_key}" private_key = "${file(var.ssh_private_key)}"
} }
inline = [ inline = [
...@@ -108,7 +108,7 @@ resource "openstack_compute_floatingip_associate_v2" "ohpc" { ...@@ -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 = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}"
#host = "${openstack_networking_floatingip_v2.terraform.address}" #host = "${openstack_networking_floatingip_v2.terraform.address}"
user = "centos" 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" { ...@@ -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 = "${format("164.111.161.%s", element(split(".", openstack_networking_floatingip_v2.ip_pool.address),3))}"
#host = "${openstack_networking_floatingip_v2.ohpc.address}" #host = "${openstack_networking_floatingip_v2.ohpc.address}"
user = "centos" user = "centos"
private_key = "${var.ssh_private_key}" private_key = "${file(var.ssh_private_key)}"
} }
inline = [ inline = [
"sudo ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` /CRI_XCBC/site.yaml -b" "sudo ansible-playbook -c local -i /CRI_XCBC/hosts -l `hostname -s` /CRI_XCBC/site.yaml -b"
......
...@@ -16,18 +16,16 @@ variable "keypair-name" { ...@@ -16,18 +16,16 @@ variable "keypair-name" {
variable "ssh_public_key" { variable "ssh_public_key" {
description = "Path to file containing public key" description = "Path to file containing public key"
default = default = "~/.ssh/id_rsa.pub"
"~/.ssh/id_rsa.pub"
} }
variable "ssh_private_key" { variable "ssh_private_key" {
description = "Path to file containing private key" description = "Path to file containing private key"
default = default = "~/.ssh/id_rsa"
"~/.ssh/id_rsa"
} }
variable "enable-dhcp" { variable "enable-dhcp" {
description = "whether dhcp in enabled. defualt is true" description = "whether dhcp in enabled. defualt is true"
default = 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