Skip to content
Snippets Groups Projects
Commit 9f80f2d8 authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Fix bootstrap-servers with invalid api_interface"

parents 8f3f675b 64b09d6e
No related branches found
No related tags found
No related merge requests found
......@@ -21,11 +21,18 @@
dest: /etc/hosts
marker: "# {mark} ANSIBLE GENERATED HOSTS"
block: |
{% for host in groups['all'] %}
{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }} {{ hostvars[host]['ansible_hostname'] }}
{% for host in groups['baremetal'] %}
{% set api_interface = hostvars[host]['api_interface'] %}
{% if host not in groups['bifrost'] or 'ansible_' + api_interface in hostvars[host] %}
{{ hostvars[host]['ansible_' + api_interface]['ipv4']['address'] }} {{ hostvars[host]['ansible_hostname'] }}
{% endif %}
{% endfor %}
become: True
when: customize_etc_hosts | bool
when:
- customize_etc_hosts | bool
# Skip hosts in the bifrost group that do not have a valid api_interface.
- inventory_hostname not in groups['bifrost'] or
'ansible_' + hostvars[inventory_hostname]['api_interface'] in hostvars[inventory_hostname]
- name: Ensure sudo group is present
group: name=sudo state=present
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment