Add new VM's to Ansible inventory
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Danny Bessems 2022-04-19 13:27:38 +02:00
parent 144c3604d5
commit dc69cd87d4
1 changed files with 7 additions and 3 deletions

View File

@ -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[*]') }}"