Commit 2e2192e4 authored by Ryan Randles Jones's avatar Ryan Randles Jones
Browse files

Update main.tf

parent 5bf584c0
......@@ -115,3 +115,32 @@ resource "openstack_compute_interface_attach_v2" "terraform2" {
network_id = "${openstack_networking_network_v2.terraform2.id}"
}
provisioner "remote-exec" {
inline = [
"hostnamectl set-hostname ohpc",
"yum install -y epel-release",
"yum install -y ansible git vim bash-completion",
"yum install -y NetworkManager",
"systemctl restart NetworkManager",
"nmcli con mod 'Wired connection 1' connection.id 'eth1'",
]
connection {
host = "${self.ipv4_address}" # The `self` variable is like `this` in many programming languages
type = "ssh" # in this case, `self` is the resource (the server).
user = "root"
private_key = "${file("~/.ssh/id_rsa")}"
}
}
provisioner "local-exec" {
environment {
PUBLIC_IP = "${self.ipv4_address}"
PRIVATE_IP = "${self.ipv4_address_private}"
}
working_dir = "$HOME/terraform-first-instance/terraform-openstack/CRI_XCBC/"
command = "ansible-playbook -c local -i hosts -l `hostname` site.yaml -b,"
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment