Skip to content
Snippets Groups Projects
Commit 2cf6280e authored by jurgenhaas's avatar jurgenhaas
Browse files

Add all farm domains to /etc/hosts

parent 7ac85eee
Branches
No related tags found
No related merge requests found
......@@ -26,9 +26,22 @@ ff02::2 ip6-allrouters
{% endif %}
{% endif %}
{% if hostvars[host]['static_ipv4'] is defined %}
{{hostvars[host]['static_ipv4']}} {{host}}
{% set ip = hostvars[host]['static_ipv4']|default() %}
{% elif hostvars[host]['ansible_default_ipv4'] is defined %}
{{hostvars[host]['ansible_default_ipv4']['address']}} {{host}}
{% set ip = hostvars[host]['ansible_default_ipv4']['address'] %}
{% else %}
{% set ip = false %}
{% endif %}
{% if ip %}
{{ ip }} {{ host }}
{% for drupal in hostvars[host]['drupal_settings']|default([]) %}
{% for domain in drupal.domains|default([]) %}
{{ ip }} {{ domain.domain }}
{% for alias in domain.aliases|default([]) %}
{{ ip }} {{ alias }}
{% endfor %}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment