summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-01-29 10:48:27 -0800
committerGitHub <noreply@github.com>2018-01-29 10:48:27 -0800
commit3346448363ead62312cb29596dcf3df5ce753ef7 (patch)
tree212fc0abfe1ab4131751db188ee53b4622bea1d6
parent6b1b0a07bc3ffec47021c4c4e77d96defc268b77 (diff)
parent59615091a29807550d5dea3a404f7d0eb25387cf (diff)
downloadopenshift-3346448363ead62312cb29596dcf3df5ce753ef7.tar.gz
openshift-3346448363ead62312cb29596dcf3df5ce753ef7.tar.bz2
openshift-3346448363ead62312cb29596dcf3df5ce753ef7.tar.xz
openshift-3346448363ead62312cb29596dcf3df5ce753ef7.zip
Merge pull request #6215 from sdodson/bz1511870
Automatic merge from submit-queue. Add kube service ipaddress to no_proxy list Computed as the first ip address in the portal_net Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1511870
-rw-r--r--playbooks/init/base_packages.yml1
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/playbooks/init/base_packages.yml b/playbooks/init/base_packages.yml
index e1052fb6c..0a730a88a 100644
--- a/playbooks/init/base_packages.yml
+++ b/playbooks/init/base_packages.yml
@@ -16,6 +16,7 @@
- iproute
- "{{ 'python3-dbus' if ansible_distribution == 'Fedora' else 'dbus-python' }}"
- "{{ 'python3-PyYAML' if ansible_distribution == 'Fedora' else 'PyYAML' }}"
+ - "{{ 'python-ipaddress' if ansible_distribution != 'Fedora' else omit }}"
- yum-utils
register: result
until: result is succeeded
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index d6d31effd..452cc4ef6 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -15,8 +15,10 @@ import os
import yaml
import struct
import socket
+import ipaddress
from distutils.util import strtobool
from distutils.version import LooseVersion
+from ansible.module_utils.six import u
from ansible.module_utils.six import string_types
from ansible.module_utils.six.moves import configparser
@@ -1146,6 +1148,8 @@ def set_proxy_facts(facts):
if 'no_proxy_internal_hostnames' in common:
common['no_proxy'].extend(common['no_proxy_internal_hostnames'].split(','))
# We always add local dns domain and ourselves no matter what
+ kube_svc_ip = str(ipaddress.ip_network(u(common['portal_net']))[1])
+ common['no_proxy'].append(kube_svc_ip)
common['no_proxy'].append('.' + common['dns_domain'])
common['no_proxy'].append('.svc')
common['no_proxy'].append(common['hostname'])