diff --git a/roles/etc_hosts/tasks/etc-hosts.yml b/roles/etc_hosts/tasks/etc-hosts.yml index 5c1b26a..39ae0d5 100644 --- a/roles/etc_hosts/tasks/etc-hosts.yml +++ b/roles/etc_hosts/tasks/etc-hosts.yml @@ -28,7 +28,7 @@ marker: "# {mark} ANSIBLE GENERATED HOSTS" block: | {% for host in groups['baremetal'] %} - {% set api_interface = hostvars[host]['api_interface'] %} + {% set api_interface = (hostvars[host]['api_interface'] | replace('-', '_')) %} {% if host not in groups['bifrost'] or api_interface in hostvars[host].ansible_facts %} {% set hostnames = [hostvars[host].ansible_facts.nodename, hostvars[host].ansible_facts.hostname] %} {{ 'api' | kolla_address(host) }} {{ hostnames | unique | join(' ') }}