Add new VM's to Ansible inventory
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2022-04-19 13:27:38 +02:00
parent 144c3604d5
commit dc69cd87d4

View File

@ -10,7 +10,7 @@
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 VM's from OVF-template
community.vmware.vmware_deploy_ovf: community.vmware.vmware_deploy_ovf:
hostname: "{{ hv.hostname }}" hostname: "{{ hv.hostname }}"
username: "{{ hv.username }}" username: "{{ hv.username }}"
@ -51,5 +51,9 @@
delay: 100 delay: 100
until: job_poll.finished until: job_poll.finished
- ansible.builtin.debug: - name: Register new VM's in inventory
var: job_poll 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[*]') }}"