Commit 86df06a0 authored by Ryan Randles Jones's avatar Ryan Randles Jones
Browse files


parent 2e2192e4
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' '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