Add intermediate task to reduce output spam
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Danny Bessems 2022-04-19 15:49:12 +02:00
parent dc69cd87d4
commit 485ba68ebb

View File

@ -51,9 +51,15 @@
delay: 100 delay: 100
until: job_poll.finished until: job_poll.finished
- name: Parse results into dictionary
ansible.builtin.set_fact:
nodes: "{{ nodes | default([]) + [ {'name': item.instance.hw_name, 'ip': item.item.item.ip | ansible.utils.ipaddr('address')} ] }}"
with_items: "{{ job_poll | json_query('results[*]') }}"
no_log: true
- name: Register new VM's in inventory - name: Register new VM's in inventory
ansible.builtin.add_host: ansible.builtin.add_host:
name: "{{ item.instance.hw_name }}" name: "{{ item.name }}"
ansible_host: "{{ item.item.item.ip | ansible.utils.ipaddr('address') }}" ansible_host: "{{ item.ip }}"
groups: k3s-ha groups: k3s_ha
with_items: "{{ job_poll | json_query('results[*]') }}" with_items: "{{ nodes }}"