diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-05-16 17:10:07 -0400 |
---|---|---|
committer | Scott Dodson <sdodson@redhat.com> | 2016-05-17 17:14:52 -0400 |
commit | 0118ca424ea4f23765c01d982b0e810b82fd8860 (patch) | |
tree | d44aec4468940f88fbdbe8d0d6894f365cad7980 | |
parent | d6e301e776ce631e13d8148041ecd86d23c543fb (diff) | |
download | openshift-0118ca424ea4f23765c01d982b0e810b82fd8860.tar.gz openshift-0118ca424ea4f23765c01d982b0e810b82fd8860.tar.bz2 openshift-0118ca424ea4f23765c01d982b0e810b82fd8860.tar.xz openshift-0118ca424ea4f23765c01d982b0e810b82fd8860.zip |
Refactor where we compute no_proxy hostnames
-rw-r--r-- | playbooks/common/openshift-master/config.yml | 7 | ||||
-rw-r--r-- | playbooks/common/openshift-node/config.yml | 14 | ||||
-rw-r--r-- | roles/openshift_facts/tasks/main.yml | 12 |
3 files changed, 22 insertions, 11 deletions
diff --git a/playbooks/common/openshift-master/config.yml b/playbooks/common/openshift-master/config.yml index 91d66a9cb..125aab0ae 100644 --- a/playbooks/common/openshift-master/config.yml +++ b/playbooks/common/openshift-master/config.yml @@ -348,6 +348,13 @@ openshift_master_session_auth_secrets: "{{ hostvars[groups.oo_first_master.0].openshift.master.session_auth_secrets }}" openshift_master_session_encryption_secrets: "{{ hostvars[groups.oo_first_master.0].openshift.master.session_encryption_secrets }}" openshift_docker_hosted_registry_network: "{{ hostvars[groups.oo_first_master.0].openshift.common.portal_net }}" + openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config'] + | union(groups['oo_masters_to_config']) + | union(groups['oo_etcd_to_config'] | default([]))) + | oo_collect('openshift.common.hostname') | default([]) | join (',') + }}" + when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and + openshift_generate_no_proxy_hosts | default(True) | bool }}" pre_tasks: - name: Ensure certificate directory exists file: diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml index a41fca45a..b3491ef8d 100644 --- a/playbooks/common/openshift-node/config.yml +++ b/playbooks/common/openshift-node/config.yml @@ -116,6 +116,13 @@ openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}" openshift_node_first_master_ip: "{{ hostvars[groups.oo_first_master.0].openshift.common.ip }}" openshift_docker_hosted_registry_network: "{{ hostvars[groups.oo_first_master.0].openshift.common.portal_net }}" + openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config'] + | union(groups['oo_masters_to_config']) + | union(groups['oo_etcd_to_config'] | default([]))) + | oo_collect('openshift.common.hostname') | default([]) | join (',') + }}" + when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and + openshift_generate_no_proxy_hosts | default(True) | bool }}" roles: - openshift_node @@ -125,6 +132,13 @@ openshift_node_master_api_url: "{{ hostvars[groups.oo_first_master.0].openshift.master.api_url }}" openshift_node_first_master_ip: "{{ hostvars[groups.oo_first_master.0].openshift.common.ip }}" openshift_docker_hosted_registry_network: "{{ hostvars[groups.oo_first_master.0].openshift.common.portal_net }}" + openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config'] + | union(groups['oo_masters_to_config']) + | union(groups['oo_etcd_to_config'] | default([]))) + | oo_collect('openshift.common.hostname') | default([]) | join (',') + }}" + when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and + openshift_generate_no_proxy_hosts | default(True) | bool }}" roles: - openshift_node diff --git a/roles/openshift_facts/tasks/main.yml b/roles/openshift_facts/tasks/main.yml index 47a82a968..f092f021f 100644 --- a/roles/openshift_facts/tasks/main.yml +++ b/roles/openshift_facts/tasks/main.yml @@ -32,18 +32,8 @@ public_hostname: "{{ openshift_public_hostname | default(None) }}" public_ip: "{{ openshift_public_ip | default(None) }}" portal_net: "{{ openshift_portal_net | default(openshift_master_portal_net) | default(None) }}" - -# had to be done outside of the above because hostname isn't yet set -- name: Gather hostnames for proxy configuration - openshift_facts: - role: common - local_facts: http_proxy: "{{ openshift_http_proxy | default(None) }}" https_proxy: "{{ openshift_https_proxy | default(None) }}" no_proxy: "{{ openshift_no_proxy | default(None) }}" generate_no_proxy_hosts: "{{ openshift_generate_no_proxy_hosts | default(True) }}" - no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config'] | default([]) - | union(groups['oo_masters_to_config'] | default([]) ) - | union(groups['oo_etcd_to_config'] | default([]))) - | oo_collect('openshift.common.hostname') | default([]) | join (',') - }}" + no_proxy_internal_hostnames: "{{ openshift_no_proxy_internal_hostnames | default(None) }}" |