diff --git a/playbook.yml b/playbook.yml index 3e552e4..b6d01fc 100644 --- a/playbook.yml +++ b/playbook.yml @@ -4,10 +4,12 @@ - hypervisor.vcenter.yml - cluster.k3s.yml tasks: + - name: Download OVF-template ansible.builtin.get_url: url: "https://{{ repo_username }}:{{ repo_password }}@{{ image.ova_url }}" dest: /scratch/image.ova + - name: Deploy VMs from OVF-template community.vmware.vmware_deploy_ovf: hostname: "{{ hv.hostname }}" @@ -34,9 +36,21 @@ guestinfo.prefixlength: "{{ item.ip | ansible.utils.ipaddr('prefix') }}" guestinfo.dnsserver: "{{ network.dnsserver }}" guestinfo.gateway: "{{ network.gateway }}" - # customization_spec: "{{ customization_spec }}" delegate_to: localhost with_items: "{{ servers }}" - register: result + register: job_init + async: 150 + poll: 0 + + - name: Poll for completion + ansible.builtin.async_status: + id: "{{ item.ansible_job_id }}" + with_items: "{{ job_init.results }}" + register: job_poll + retries: 5 + delay: 30 + until: job_poll.finished + - ansible.builtin.debug: - msg: result + msg: "{{ job_init }} {{ job_poll }}" + diff --git a/vars/cluster.k3s.yml b/vars/cluster.k3s.yml index 0cf782c..cafaa6c 100644 --- a/vars/cluster.k3s.yml +++ b/vars/cluster.k3s.yml @@ -10,8 +10,5 @@ network: gateway: 192.168.11.1 servers: - ip: 192.168.11.121/24 - guest_id: ubuntu64Guest - ip: 192.168.11.122/24 - guest_id: ubuntu64Guest - ip: 192.168.11.123/24 - guest_id: ubuntu64Guest