working ansible
This commit is contained in:
parent
271d75b7bd
commit
a6afac22f5
3 changed files with 12 additions and 2 deletions
|
@ -1,5 +1,13 @@
|
||||||
|
---
|
||||||
- hosts: all
|
- hosts: all
|
||||||
|
|
||||||
|
gather_facts: no
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: Wait for system to become reachable
|
||||||
|
wait_for_connection:
|
||||||
|
|
||||||
|
- name: Gather facts for the first time
|
||||||
|
setup:
|
||||||
- name: ensure file exists
|
- name: ensure file exists
|
||||||
copy:
|
copy:
|
||||||
content: ""
|
content: ""
|
||||||
|
|
|
@ -11,5 +11,3 @@ chpasswd:
|
||||||
expire: False
|
expire: False
|
||||||
packages:
|
packages:
|
||||||
- qemu-guest-agent
|
- qemu-guest-agent
|
||||||
ansible:
|
|
||||||
install_method: pip
|
|
||||||
|
|
4
main.tf
4
main.tf
|
@ -49,4 +49,8 @@ resource "libvirt_domain" "ubuntu" {
|
||||||
}
|
}
|
||||||
|
|
||||||
cloudinit = libvirt_cloudinit_disk.cloudinit.id
|
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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue