Fix chicken and egg problem with proxy_env not defined on the first … (#5896)
* Fix chicken and egg problem with proxy_env not defined on the first envinronment usage. * Disable fact gathering for the first proxy_env evaluation. * Move proxy_env var set up from the role defaults to the root playbooks as fact.
This commit is contained in:
parent
2c21e7bd3a
commit
910a821d0b
4 changed files with 78 additions and 44 deletions
14
cluster.yml
14
cluster.yml
|
@ -13,6 +13,20 @@
|
|||
vars:
|
||||
ansible_connection: local
|
||||
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: "Set up proxy environment"
|
||||
set_fact:
|
||||
proxy_env:
|
||||
http_proxy: "{{ http_proxy | default ('') }}"
|
||||
HTTP_PROXY: "{{ http_proxy | default ('') }}"
|
||||
https_proxy: "{{ https_proxy | default ('') }}"
|
||||
HTTPS_PROXY: "{{ https_proxy | default ('') }}"
|
||||
no_proxy: "{{ no_proxy | default ('') }}"
|
||||
NO_PROXY: "{{ no_proxy | default ('') }}"
|
||||
no_log: true
|
||||
|
||||
- hosts: bastion[0]
|
||||
gather_facts: False
|
||||
roles:
|
||||
|
|
|
@ -437,14 +437,6 @@ no_proxy: >-
|
|||
127.0.0.1,localhost,{{kube_service_addresses}},{{kube_pods_subnet}}
|
||||
{%- endif %}
|
||||
|
||||
proxy_env:
|
||||
http_proxy: "{{ http_proxy| default ('') }}"
|
||||
HTTP_PROXY: "{{ http_proxy| default ('') }}"
|
||||
https_proxy: "{{ https_proxy| default ('') }}"
|
||||
HTTPS_PROXY: "{{ https_proxy| default ('') }}"
|
||||
no_proxy: "{{ no_proxy| default ('') }}"
|
||||
NO_PROXY: "{{ no_proxy| default ('') }}"
|
||||
|
||||
ssl_ca_dirs: >-
|
||||
[
|
||||
{% if ansible_os_family in ['CoreOS', 'Container Linux by CoreOS', 'Flatcar', 'Flatcar Container Linux by Kinvolk'] -%}
|
||||
|
|
14
scale.yml
14
scale.yml
|
@ -13,6 +13,20 @@
|
|||
vars:
|
||||
ansible_connection: local
|
||||
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: "Set up proxy environment"
|
||||
set_fact:
|
||||
proxy_env:
|
||||
http_proxy: "{{ http_proxy | default ('') }}"
|
||||
HTTP_PROXY: "{{ http_proxy | default ('') }}"
|
||||
https_proxy: "{{ https_proxy | default ('') }}"
|
||||
HTTPS_PROXY: "{{ https_proxy | default ('') }}"
|
||||
no_proxy: "{{ no_proxy | default ('') }}"
|
||||
NO_PROXY: "{{ no_proxy | default ('') }}"
|
||||
no_log: true
|
||||
|
||||
- hosts: bastion[0]
|
||||
gather_facts: False
|
||||
roles:
|
||||
|
|
|
@ -13,6 +13,20 @@
|
|||
vars:
|
||||
ansible_connection: local
|
||||
|
||||
- hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: "Set up proxy environment"
|
||||
set_fact:
|
||||
proxy_env:
|
||||
http_proxy: "{{ http_proxy | default ('') }}"
|
||||
HTTP_PROXY: "{{ http_proxy | default ('') }}"
|
||||
https_proxy: "{{ https_proxy | default ('') }}"
|
||||
HTTPS_PROXY: "{{ https_proxy | default ('') }}"
|
||||
no_proxy: "{{ no_proxy | default ('') }}"
|
||||
NO_PROXY: "{{ no_proxy | default ('') }}"
|
||||
no_log: true
|
||||
|
||||
- hosts: bastion[0]
|
||||
gather_facts: False
|
||||
roles:
|
||||
|
|
Loading…
Reference in a new issue