From e2579a01161406492320a5363daa3c10bc80d563 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Wed, 27 Apr 2016 11:27:17 -0400 Subject: Fix openshift_generate_no_proxy_hosts examples --- inventory/byo/hosts.aep.example | 2 +- inventory/byo/hosts.origin.example | 2 +- inventory/byo/hosts.ose.example | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inventory/byo/hosts.aep.example b/inventory/byo/hosts.aep.example index 193a2229f..54033c325 100644 --- a/inventory/byo/hosts.aep.example +++ b/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 diff --git a/inventory/byo/hosts.origin.example b/inventory/byo/hosts.origin.example index ebc5801c8..ef363ca16 100644 --- a/inventory/byo/hosts.origin.example +++ b/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 diff --git a/inventory/byo/hosts.ose.example b/inventory/byo/hosts.ose.example index 650dfe498..6123e580b 100644 --- a/inventory/byo/hosts.ose.example +++ b/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 -- cgit v1.2.3 From 83f9edc249db6b629f6f6fdb19d1c363f70133eb Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Wed, 27 Apr 2016 13:34:40 -0400 Subject: Fix openshift_generate_no_proxy_hosts boolean Fixing this also made it obvious that we weren't adding even the current host's name to the no_proxy list. This is absolutely necessary or the master won't be able to reach etcd. So even if they request not to have the list of all hosts and cluster dns zone added we should add the current host's hostname to the no_proxy list. --- roles/openshift_facts/library/openshift_facts.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 8d7f12bc8..c102770a0 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -499,12 +499,12 @@ def set_dnsmasq_facts_if_unset(facts): """ if 'common' in facts: - if 'use_dnsmasq' not in facts['common'] and facts['common']['version_gte_3_2_or_1_2']: + if 'use_dnsmasq' not in facts['common'] and safe_get_bool(facts['common']['version_gte_3_2_or_1_2']): facts['common']['use_dnsmasq'] = True else: facts['common']['use_dnsmasq'] = False if 'master' in facts and 'dns_port' not in facts['master']: - if facts['common']['use_dnsmasq']: + if safe_get_bool(facts['common']['use_dnsmasq']): facts['master']['dns_port'] = 8053 else: facts['master']['dns_port'] = 53 @@ -1369,18 +1369,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: -- cgit v1.2.3