From c591b1e39f204334eabef62e38c0e2dda828adcd Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 6 Apr 2020 13:36:15 -0400 Subject: [PATCH] Include upstream and short names in hosts --- roles/base/templates/etc/hosts.j2 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/base/templates/etc/hosts.j2 b/roles/base/templates/etc/hosts.j2 index 2cfc6a7..1b0f6fa 100644 --- a/roles/base/templates/etc/hosts.j2 +++ b/roles/base/templates/etc/hosts.j2 @@ -7,8 +7,9 @@ ff02::1 ip6-allmodes ff02::2 ip6-allrouters {% for node in pvc_nodes %} -{{ node.cluster_ip }} {{ node.hostname }}.{{ pvc_cluster_domain }} {{ node.hostname }} -{{ node.storage_ip }} {{ node.hostname }}.{{ pvc_storage_domain }} +{{ node.cluster_ip }} {{ node.hostname.split('.')[0] }}.{{ pvc_cluster_domain }} {{ node.hostname.split('.')[0] }} +{{ node.storage_ip }} {{ node.hostname.split('.')[0] }}.{{ pvc_storage_domain }} +{{ node.upstream_ip }} {{ node.hostname.split('.')[0] }}.{{ local_domain }} {% endfor %} {% if hosts is defined %}