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

Delete terraform-ssh-remote-exec.tf

parent 2e2192e4
No related branches found
No related tags found
No related merge requests found
resource "openstack" "vm" {
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,"
}
}
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