Wait 30secs before running ansible
This commit is contained in:
parent
4e98e9c63f
commit
a4c5d75976
1 changed files with 1 additions and 11 deletions
12
main.tf
12
main.tf
|
|
@ -16,18 +16,8 @@ resource "aws_instance" "jamulus" {
|
||||||
key_name = "jamulus"
|
key_name = "jamulus"
|
||||||
security_groups = [aws_security_group.ssh.name, aws_security_group.jamulus.name, aws_security_group.node-exporter.name] # Add your own IP to this group
|
security_groups = [aws_security_group.ssh.name, aws_security_group.jamulus.name, aws_security_group.node-exporter.name] # Add your own IP to this group
|
||||||
|
|
||||||
provisioner "remote-exec" {
|
|
||||||
inline = ["sudo apt update", "sudo apt install python3 -y", "echo Done!"]
|
|
||||||
connection {
|
|
||||||
type = "ssh"
|
|
||||||
user = "ubuntu"
|
|
||||||
host = self.public_ip
|
|
||||||
private_key = file("${path.module}/jamulus.pem")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu -i '${self.public_ip},' --private-key ${"${path.module}/jamulus.pem"} jamulus-install.yml"
|
command = "sleep 30 && ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu -i '${self.public_ip},' --private-key ${"${path.module}/jamulus.pem"} jamulus-install.yml"
|
||||||
}
|
}
|
||||||
|
|
||||||
tags = {
|
tags = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue