Merge pull request #757 from kubernetes-incubator/issue754
Add dns_domain for each host to /etc/hosts
This commit is contained in:
commit
3bf2c0f54f
1 changed files with 1 additions and 2 deletions
|
@ -3,8 +3,7 @@
|
|||
blockinfile:
|
||||
dest: /etc/hosts
|
||||
block: |-
|
||||
{% 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'] }}{% endif %} {{ item }}
|
||||
{% 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 }}
|
||||
{% endfor %}
|
||||
state: present
|
||||
create: yes
|
||||
|
|
Loading…
Reference in a new issue