diff --git a/ansible.yml b/ansible.yml index 1f2a418..58cd217 100644 --- a/ansible.yml +++ b/ansible.yml @@ -1,5 +1,13 @@ +--- - 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: ensure file exists copy: content: "" diff --git a/cloud_init.cfg.tftpl b/cloud_init.cfg.tftpl index 1e6f2b1..d67ccbc 100644 --- a/cloud_init.cfg.tftpl +++ b/cloud_init.cfg.tftpl @@ -11,5 +11,3 @@ chpasswd: expire: False packages: - qemu-guest-agent -ansible: - install_method: pip diff --git a/main.tf b/main.tf index e75dd58..dd15196 100644 --- a/main.tf +++ b/main.tf @@ -49,4 +49,8 @@ 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 '192.168.30.7,' ansible.yml" + } }