diff --git a/roles/multi-node-hosts-file/tasks/main.yaml b/roles/multi-node-hosts-file/tasks/main.yaml index dc05a9537..a54bc5f21 100644 --- a/roles/multi-node-hosts-file/tasks/main.yaml +++ b/roles/multi-node-hosts-file/tasks/main.yaml @@ -4,6 +4,7 @@ {% set hosts = {} -%} {% for host, vars in hostvars.items() -%} {% set _ = hosts.update({host: vars['nodepool']['private_ipv4']}) -%} + {% set _ = hosts.update({vars['ansible_hostname']: vars['nodepool']['private_ipv4']}) -%} {% endfor -%} {{- hosts -}}