Skip to content

Commit

Permalink
chore: Update EC2 Terraform configuration to use ANSIBLE_HOST_KEY_CHE…
Browse files Browse the repository at this point in the history
…CKING=False
  • Loading branch information
nilgaar committed Jul 13, 2024
1 parent 5277acb commit e5246d6
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions IaC/aws/terraform/ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,7 @@ resource "aws_instance" "ec2example" {
associate_public_ip_address = true
key_name = aws_key_pair.ec2_key_pair.key_name

provisioner "remote-exec" {
inline = [
"echo 'Waiting for instance to be fully ready...'",
"sleep 240"
]
}

provisioner "local-exec" {
command = "ansible-playbook -i '${self.public_ip},' ${path.module}/../../ansible/apache.yml"
}

connection {
type = "ssh"
user = "ubuntu"
host = self.public_ip
command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i '${self.public_ip},' ${path.module}/../../ansible/apache.yml"
}
}

0 comments on commit e5246d6

Please sign in to comment.