Skip to content
Snippets Groups Projects
Commit a2f8f172 authored by Antoine Legrand's avatar Antoine Legrand Committed by GitHub
Browse files

Merge pull request #757 from kubernetes-incubator/issue754

Add dns_domain for each host to /etc/hosts
parents 0e2329b5 68ad4ff4
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
blockinfile: blockinfile:
dest: /etc/hosts dest: /etc/hosts
block: |- block: |-
{% for item in groups['all'] -%} {% for item in groups['all'] -%}{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address)) }}{% if (item != hostvars[item]['ansible_hostname']) %} {{ hostvars[item]['ansible_hostname'] }} {{ hostvars[item]['ansible_hostname'] }}.{{ dns_domain }}{% endif %} {{ item }} {{ item }}.{{ dns_domain }}
{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address)) }}{% if (item != hostvars[item]['ansible_hostname']) %} {{ hostvars[item]['ansible_hostname'] }}{% endif %} {{ item }}
{% endfor %} {% endfor %}
state: present state: present
create: yes create: yes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment