Skip to content

Instantly share code, notes, and snippets.

@scarolan
Created December 4, 2018 20:56
Show Gist options
  • Save scarolan/5d996ffab388658b897161d43128726d to your computer and use it in GitHub Desktop.
Save scarolan/5d996ffab388658b897161d43128726d to your computer and use it in GitHub Desktop.
provisioner "remote-exec" {
inline = ["echo 'Hello World'"]
connection {
type = "ssh"
user = "ec2-user"
private_key = "${file("${var.private_key_path}")}"
}
}
provisioner "local-exec" {
command = "ansible-playbook -i '${aws_instance.example.private_ip},' --private-key ${var.private_key_path} ../ansible/httpd.yml"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment