parent
114ab5e4e6
commit
68ad4ff4d9
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue