Improve proxy (#1771)

* Set no_proxy to all local ips

* Use proxy settings on all necessary tasks
This commit is contained in:
Matthew Mosesohn
2017-10-11 19:47:27 +01:00
committed by GitHub
parent 83be0735cd
commit eb0dcf6063
10 changed files with 46 additions and 11 deletions

View File

@@ -162,6 +162,28 @@ vault_config_dir: "{{ vault_base_dir }}/config"
vault_roles_dir: "{{ vault_base_dir }}/roles"
vault_secrets_dir: "{{ vault_base_dir }}/secrets"
## Set no_proxy to all assigned cluster IPs and hostnames
no_proxy: >-
127.0.0.1
localhost
{% if loadbalancer_apiserver is defined %}
{{ apiserver_loadbalancer_domain_name| default('') }}
{{ loadbalancer_apiserver.address | default('') }}
{% endif %}
{% for item in (groups['k8s-cluster'] + groups['etcd'] + groups['calico-rr']|default([]))|unique -%}
{{ hostvars[item]['access_ip'] | default(hostvars[item]['ip'] | default(hostvars[item]['ansible_default_ipv4']['address'])) }}
{% if (item != hostvars[item]['ansible_hostname']) %} {{ hostvars[item]['ansible_hostname'] }}
{{ hostvars[item]['ansible_hostname'] }}.{{ dns_domain }}
{% endif %}
{{ item }}
{{ item }}.{{ dns_domain }}
{% endfor %}
proxy_env:
http_proxy: "{{ http_proxy| default ('') }}"
https_proxy: "{{ https_proxy| default ('') }}"
no_proxy: "{{ no_proxy }}"
# Vars for pointing to kubernetes api endpoints
is_kube_master: "{{ inventory_hostname in groups['kube-master'] }}"
kube_apiserver_count: "{{ groups['kube-master'] | length }}"