From 0b1424514afad21741ba5b1d1a36f182ee51c580 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Sun, 12 Mar 2023 21:21:43 +0100 Subject: [PATCH] temporary fix for ansible --- ansible.yml | 9 +++------ inventory | 3 +++ main.tf | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 inventory 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" } }