Browse Source

Merge pull request #5569 from ganhuang/all-hosts-no-proxy

Generate internal hostnames of no_proxy
Scott Dodson 7 years ago
parent
commit
d3ae358d8e
1 changed files with 13 additions and 1 deletions
  1. 13 1
      playbooks/common/openshift-cluster/initialize_facts.yml

+ 13 - 1
playbooks/common/openshift-cluster/initialize_facts.yml

@@ -145,7 +145,19 @@
         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: "{{ openshift_no_proxy_internal_hostnames | default(None) }}"
+
+  - name: Set fact of no_proxy_internal_hostnames
+    openshift_facts:
+      role: common
+      local_facts:
+        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
+    - openshift_generate_no_proxy_hosts | default(True) | bool
 
   - name: initialize_facts set_fact repoquery command
     set_fact: