Housekeeping; Change to async processing
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Danny Bessems 2022-04-19 12:07:26 +02:00
parent 378a584b14
commit e4bf846a57
2 changed files with 17 additions and 6 deletions

View File

@ -4,10 +4,12 @@
- hypervisor.vcenter.yml - hypervisor.vcenter.yml
- cluster.k3s.yml - cluster.k3s.yml
tasks: tasks:
- name: Download OVF-template - name: Download OVF-template
ansible.builtin.get_url: ansible.builtin.get_url:
url: "https://{{ repo_username }}:{{ repo_password }}@{{ image.ova_url }}" url: "https://{{ repo_username }}:{{ repo_password }}@{{ image.ova_url }}"
dest: /scratch/image.ova dest: /scratch/image.ova
- name: Deploy VMs from OVF-template - name: Deploy VMs from OVF-template
community.vmware.vmware_deploy_ovf: community.vmware.vmware_deploy_ovf:
hostname: "{{ hv.hostname }}" hostname: "{{ hv.hostname }}"
@ -34,9 +36,21 @@
guestinfo.prefixlength: "{{ item.ip | ansible.utils.ipaddr('prefix') }}" guestinfo.prefixlength: "{{ item.ip | ansible.utils.ipaddr('prefix') }}"
guestinfo.dnsserver: "{{ network.dnsserver }}" guestinfo.dnsserver: "{{ network.dnsserver }}"
guestinfo.gateway: "{{ network.gateway }}" guestinfo.gateway: "{{ network.gateway }}"
# customization_spec: "{{ customization_spec }}"
delegate_to: localhost delegate_to: localhost
with_items: "{{ servers }}" 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: - ansible.builtin.debug:
msg: result msg: "{{ job_init }} {{ job_poll }}"

View File

@ -10,8 +10,5 @@ network:
gateway: 192.168.11.1 gateway: 192.168.11.1
servers: servers:
- ip: 192.168.11.121/24 - ip: 192.168.11.121/24
guest_id: ubuntu64Guest
- ip: 192.168.11.122/24 - ip: 192.168.11.122/24
guest_id: ubuntu64Guest
- ip: 192.168.11.123/24 - ip: 192.168.11.123/24
guest_id: ubuntu64Guest