From 2a4fb438fea6c47a5815e0bf5f5f5ed6eef65e52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rados=C5=82aw=20Piliszek?= <radoslaw.piliszek@gmail.com>
Date: Fri, 4 Sep 2020 11:13:52 +0200
Subject: [PATCH] Make no_proxy handling more robust

This fixes an issue with Bifrost that setting
kolla_internal_vip_address became mandatory.

Additionally, it does a better job ensuring the syntax is
correct when any of the entries is missing.

Change-Id: Ie86a345365ca3766aebd8a29ce329b370e61af6c
Closes-Bug: #1894199
---
 ansible/group_vars/all.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index f04a5bd7e0..53562ef644 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -57,10 +57,15 @@ container_http_proxy: ""
 container_https_proxy: ""
 container_no_proxy: "localhost,127.0.0.1"
 
+container_proxy_no_proxy_entries:
+  - "{{ container_no_proxy }}"
+  - "{{ api_interface_address }}"
+  - "{{ kolla_internal_vip_address | default('') }}"
+
 container_proxy:
   http_proxy: "{{ container_http_proxy }}"
   https_proxy: "{{ container_https_proxy }}"
-  no_proxy: "{{ container_no_proxy }},{{ api_interface_address }},{{ kolla_internal_vip_address }}"
+  no_proxy: "{{ container_proxy_no_proxy_entries | select | join(',') }}"
 
 # By default, Kolla API services bind to the network address assigned
 # to the api_interface.  Allow the bind address to be an override.