Skip to content

Commit 24aed67

Browse files
authored
configure install-config.yaml proxy when required (#1697)
1 parent 872f6b8 commit 24aed67

File tree

5 files changed

+45
-0
lines changed

5 files changed

+45
-0
lines changed

agent/05_agent_configure.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,12 @@ function generate_cluster_manifests() {
318318
export AGENT_NODES_BMC_ADDRESSES_STR=${nodes_bmc_addresses::-1}
319319
set -x
320320

321+
if [[ ! -z "$INSTALLER_PROXY" ]]; then
322+
export AGENT_HTTP_PROXY=${HTTP_PROXY}
323+
export AGENT_HTTPS_PROXY=${HTTPS_PROXY}
324+
export AGENT_NO_PROXY=${NO_PROXY}
325+
fi
326+
321327
# Create manifests
322328
ansible-playbook -vvv \
323329
-e install_path=${SCRIPTDIR}/${INSTALL_CONFIG_PATH} \

agent/roles/manifests/templates/install-config_baremetal_yaml.j2

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,15 @@ imageContentSources:
122122
{% endif %}
123123
additionalTrustBundle: {{ ca_bundle_crt }}
124124
{% endif %}
125+
{% if http_proxy or https_proxy or no_proxy %}
126+
proxy:
127+
{% if http_proxy %}
128+
httpProxy: "{{ http_proxy }}"
129+
{% endif %}
130+
{% if https_proxy %}
131+
httpsProxy: "{{ https_proxy }}"
132+
{% endif %}
133+
{% if no_proxy %}
134+
noProxy: "{{ no_proxy }}"
135+
{% endif %}
136+
{% endif %}

agent/roles/manifests/templates/install-config_vsphere_yaml.j2

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,15 @@ additionalTrustBundle: {{ ca_bundle_crt }}
9797
{% elif enable_local_registry %}
9898
additionalTrustBundle: {{ registry_certificate }}
9999
{% endif %}
100+
{% if http_proxy or https_proxy or no_proxy %}
101+
proxy:
102+
{% if http_proxy %}
103+
httpProxy: "{{ http_proxy }}"
104+
{% endif %}
105+
{% if https_proxy %}
106+
httpsProxy: "{{ https_proxy }}"
107+
{% endif %}
108+
{% if no_proxy %}
109+
noProxy: "{{ no_proxy }}"
110+
{% endif %}
111+
{% endif %}

agent/roles/manifests/templates/install-config_yaml.j2

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,15 @@ additionalTrustBundle: {{ ca_bundle_crt }}
9191
{% elif enable_local_registry %}
9292
additionalTrustBundle: {{ registry_certificate }}
9393
{% endif %}
94+
{% if http_proxy or https_proxy or no_proxy %}
95+
proxy:
96+
{% if http_proxy %}
97+
httpProxy: "{{ http_proxy }}"
98+
{% endif %}
99+
{% if https_proxy %}
100+
httpsProxy: "{{ https_proxy }}"
101+
{% endif %}
102+
{% if no_proxy %}
103+
noProxy: "{{ no_proxy }}"
104+
{% endif %}
105+
{% endif %}

agent/roles/manifests/vars/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ external_subnet_v6: "{{ lookup('env', 'EXTERNAL_SUBNET_V6') }}"
3131
external_subnet_v4_prefixlen: "{{ lookup('env', 'EXTERNAL_SUBNET_V4') | ansible.utils.ipaddr('prefix') }}"
3232
external_subnet_v6_prefixlen: "{{ lookup('env', 'EXTERNAL_SUBNET_V6') | ansible.utils.ipaddr('prefix') }}"
3333
fips_mode: "{{ lookup('env', 'FIPS_MODE') | bool }}"
34+
http_proxy: "{{ lookup('env', 'AGENT_HTTP_PROXY') }}"
35+
https_proxy: "{{ lookup('env', 'AGENT_HTTPS_PROXY') }}"
3436
image: "{{ lookup('env', 'IMAGE') }}"
3537
ip_stack: "{{ lookup('env', 'IP_STACK') }}"
3638
local_image_url_suffix: "{{ lookup('env', 'LOCAL_IMAGE_URL_SUFFIX') }}"
@@ -46,6 +48,7 @@ network_type: "{{ lookup('env', 'NETWORK_TYPE') }}"
4648
num_masters: "{{ lookup('env', 'NUM_MASTERS') }}"
4749
num_workers: "{{ lookup('env', 'NUM_WORKERS') }}"
4850
num_extra_workers: "{{ lookup('env', 'NUM_EXTRA_WORKERS', default='0') }}"
51+
no_proxy: "{{ lookup('env', 'AGENT_NO_PROXY') }}"
4952
platform_type: "{{ lookup('env', 'AGENT_PLATFORM_TYPE') }}"
5053
platform_name: "{{ lookup('env', 'AGENT_PLATFORM_NAME') }}"
5154
provisioning_host_external_ip: "{{ lookup('env', 'PROVISIONING_HOST_EXTERNAL_IP') }}"

0 commit comments

Comments
 (0)