diff --git a/playbook.yml b/playbook.yml index a31ecfe..45e2822 100644 --- a/playbook.yml +++ b/playbook.yml @@ -10,7 +10,7 @@ url: "https://{{ repo_username }}:{{ repo_password }}@{{ image.ova_url }}" dest: /scratch/image.ova - - name: Deploy VMs from OVF-template + - name: Deploy VM's from OVF-template community.vmware.vmware_deploy_ovf: hostname: "{{ hv.hostname }}" username: "{{ hv.username }}" @@ -51,5 +51,9 @@ delay: 100 until: job_poll.finished - - ansible.builtin.debug: - var: job_poll + - name: Register new VM's in inventory + ansible.builtin.add_host: + name: "{{ item.instance.hw_name }}" + ansible_host: "{{ item.item.item.ip | ansible.utils.ipaddr('address') }}" + groups: k3s-ha + with_items: "{{ job_poll | json_query('results[*]') }}"