Browse Source

Merge pull request #1828 from sdodson/bz1330920

Fix openshift_generate_no_proxy_hosts boolean
Jason DeTiberus 9 năm trước cách đây
mục cha
commit
88806a06a5

+ 1 - 1
inventory/byo/hosts.aep.example

@@ -367,7 +367,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
 # etcd hosts. So automatically add those hostnames to the openshift_no_proxy list.
 # If all of your hosts share a common domain you may wish to disable this and 
 # specify that domain above.
-#openshift_generate_no_proxy_hosts: True
+#openshift_generate_no_proxy_hosts=True
 #
 # These options configure the BuildDefaults admission controller which injects
 # environment variables into Builds. These values will default to their

+ 1 - 1
inventory/byo/hosts.origin.example

@@ -372,7 +372,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
 # etcd hosts. So automatically add those hostnames to the openshift_no_proxy list.
 # If all of your hosts share a common domain you may wish to disable this and 
 # specify that domain above.
-#openshift_generate_no_proxy_hosts: True
+#openshift_generate_no_proxy_hosts=True
 #
 # These options configure the BuildDefaults admission controller which injects
 # environment variables into Builds. These values will default to their

+ 1 - 1
inventory/byo/hosts.ose.example

@@ -368,7 +368,7 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
 # etcd hosts. So automatically add those hostnames to the openshift_no_proxy list.
 # If all of your hosts share a common domain you may wish to disable this and 
 # specify that domain above.
-#openshift_generate_no_proxy_hosts: True
+#openshift_generate_no_proxy_hosts=True
 #
 # These options configure the BuildDefaults admission controller which injects
 # environment variables into Builds. These values will default to their

+ 9 - 8
roles/openshift_facts/library/openshift_facts.py

@@ -1374,18 +1374,19 @@ def set_proxy_facts(facts):
     if 'common' in facts:
         common = facts['common']
         if 'http_proxy' in common or 'https_proxy' in common:
+            if 'no_proxy' in common and \
+                isinstance(common['no_proxy'], basestring):
+                common['no_proxy'] = common['no_proxy'].split(",")
+            elif 'no_proxy' not in common:
+                common['no_proxy'] = []
             if 'generate_no_proxy_hosts' in common and \
-                    common['generate_no_proxy_hosts']:
-                if 'no_proxy' in common and \
-                    isinstance(common['no_proxy'], basestring):
-                    common['no_proxy'] = common['no_proxy'].split(",")
-                else:
-                    common['no_proxy'] = []
+                safe_get_bool(common['generate_no_proxy_hosts']):
                 if 'no_proxy_internal_hostnames' in common:
                     common['no_proxy'].extend(common['no_proxy_internal_hostnames'].split(','))
                 common['no_proxy'].append('.' + common['dns_domain'])
-                common['no_proxy'].append(common['hostname'])
-                common['no_proxy'] = sort_unique(common['no_proxy'])
+            # We always add ourselves no matter what
+            common['no_proxy'].append(common['hostname'])
+            common['no_proxy'] = sort_unique(common['no_proxy'])
         facts['common'] = common
 
     if 'builddefaults' in facts: