diff --git a/ansible.yml b/ansible.yml index 64c996b..b6b9fa7 100644 --- a/ansible.yml +++ b/ansible.yml @@ -2,12 +2,9 @@ - hosts: all gather_facts: no tasks: - - name: Wait for system to become reachable - wait_for_connection: - - name: Gather facts for the first time - setup: - - name: Wait for cloud-init to finish - command: cloud-init status --wait + - name: Wait for cloud init to finish + pause: + minutes: 2 - name: Update repositories apt: autoremove: true diff --git a/inventory b/inventory new file mode 100644 index 0000000..2efb608 --- /dev/null +++ b/inventory @@ -0,0 +1,3 @@ +[targets] + +192.168.30.7 ansible_connection=ssh ansible_user=root diff --git a/main.tf b/main.tf index c931c22..fc52cdc 100644 --- a/main.tf +++ b/main.tf @@ -51,6 +51,6 @@ resource "libvirt_domain" "ubuntu" { cloudinit = libvirt_cloudinit_disk.cloudinit.id provisioner "local-exec" { - command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -T 60 -u root -i '${var.internal_ip},' ansible.yml" + command = "ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -T 60 -u root -i inventory ansible.yml" } }