mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-15 02:00:03 -03:30
Hostname alias fixes
Change the kubelet --hostname-override flag to use the ansible_hostname variable which should be more consistent with the value required by cloud providers Add ansible_hostname alias to /etc/hosts when it is different from inventory_hostname to overcome node name limitations see https://github.com/kubernetes/kubernetes/issues/22770 Signed-off-by: Chad Swenson <chadswen@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
dest: /etc/hosts
|
||||
block: |-
|
||||
{% for item in groups['all'] -%}
|
||||
{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item].ansible_default_ipv4.address)) }} {{ item }}
|
||||
{{ 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 %}
|
||||
state: present
|
||||
create: yes
|
||||
|
||||
Reference in New Issue
Block a user