From f103dd9e0deed83bf3b4d713c0bfafa9af15693a Mon Sep 17 00:00:00 2001 From: djpbessems Date: Fri, 22 Apr 2022 23:37:58 +0200 Subject: [PATCH] Finetune loop_control #2 --- playbook.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playbook.yml b/playbook.yml index d192718..f556563 100644 --- a/playbook.yml +++ b/playbook.yml @@ -61,7 +61,7 @@ nodes: "{{ nodes | default([]) + [ {'name': item.instance.hw_name, 'ip': item.item.item.ip | ansible.utils.ipaddr('address')} ] }}" loop: "{{ job_poll | json_query('results[*]') }}" loop_control: - label: "{{ { 'name': item.item.name, 'ip': item.item.ip } }}" + label: "{{ { 'name': item.instance.hw_name, 'ip': item.item.item.ip } }}" - name: Register new VM's in inventory ansible.builtin.add_host: @@ -83,7 +83,7 @@ register: publickeys loop: "{{ nodes }}" loop_control: - label: "{{ { 'name': item.name, 'ip': item.ip } }}" + label: "{{ item.ip }}" - name: Store public keys ansible.builtin.known_hosts: @@ -93,7 +93,7 @@ path: ~/.ssh/known_hosts loop: "{{ publickeys.results }}" loop_control: - label: "{{ { 'name': item.name, 'ip': item.ip } }}" + label: "{{ item.item.name, 'ip': item.item.ip } }}" - name: Provision Kubernetes hosts: k3s_ha