Browse Source

Fix etc hosts for cluster nodes

Signed-off-by: Bogdan Dobrelya <bogdando@mail.ru>
pull/847/head
Bogdan Dobrelya 7 years ago
parent
commit
97f96a6376
1 changed files with 1 additions and 1 deletions
  1. 2
      roles/kubernetes/preinstall/tasks/etchosts.yml

2
roles/kubernetes/preinstall/tasks/etchosts.yml

@ -3,7 +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'] }} {{ hostvars[item]['ansible_hostname'] }}.{{ dns_domain }}{% endif %} {{ item }} {{ item }}.{{ dns_domain }}
{% for item in (groups['k8s-cluster'] + groups['etcd'] + groups['calico-rr']|default([]))|unique -%}{{ 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…
Cancel
Save