From 3ee91e15ff8d9deb3e95181e00889127ba04a8bb Mon Sep 17 00:00:00 2001
From: Matthew Mosesohn <matthew.mosesohn@gmail.com>
Date: Fri, 13 Oct 2017 15:43:10 +0100
Subject: [PATCH] Use commas in no_proxy (#1782)

---
 roles/kubespray-defaults/defaults/main.yaml | 27 ++++++++++-----------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml
index e02e20ad4..f8d4e99c5 100644
--- a/roles/kubespray-defaults/defaults/main.yaml
+++ b/roles/kubespray-defaults/defaults/main.yaml
@@ -164,20 +164,19 @@ vault_secrets_dir: "{{ vault_base_dir }}/secrets"
 
 ## Set no_proxy to all assigned cluster IPs and hostnames
 no_proxy: >-
-  127.0.0.1
-  localhost
-  {% if loadbalancer_apiserver is defined %}
-    {{ apiserver_loadbalancer_domain_name| default('') }}
-    {{ loadbalancer_apiserver.address | default('') }}
-  {% endif %}
-  {% 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 %}
+  {%- if loadbalancer_apiserver is defined -%}
+  {{ apiserver_loadbalancer_domain_name| default('') }},
+  {{ loadbalancer_apiserver.address | default('') }},
+  {%- endif -%}
+  {%- 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 -%}
+  127.0.0.1,localhost
 
 proxy_env:
   http_proxy: "{{ http_proxy| default ('') }}"
-- 
GitLab