Skip to content

Commit

Permalink
configure install-config.yaml proxy when required (#1697)
Browse files Browse the repository at this point in the history
  • Loading branch information
andfasano authored Aug 28, 2024
1 parent 872f6b8 commit 24aed67
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/05_agent_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ function generate_cluster_manifests() {
export AGENT_NODES_BMC_ADDRESSES_STR=${nodes_bmc_addresses::-1}
set -x

if [[ ! -z "$INSTALLER_PROXY" ]]; then
export AGENT_HTTP_PROXY=${HTTP_PROXY}
export AGENT_HTTPS_PROXY=${HTTPS_PROXY}
export AGENT_NO_PROXY=${NO_PROXY}
fi

# Create manifests
ansible-playbook -vvv \
-e install_path=${SCRIPTDIR}/${INSTALL_CONFIG_PATH} \
Expand Down
12 changes: 12 additions & 0 deletions agent/roles/manifests/templates/install-config_baremetal_yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,15 @@ imageContentSources:
{% endif %}
additionalTrustBundle: {{ ca_bundle_crt }}
{% endif %}
{% if http_proxy or https_proxy or no_proxy %}
proxy:
{% if http_proxy %}
httpProxy: "{{ http_proxy }}"
{% endif %}
{% if https_proxy %}
httpsProxy: "{{ https_proxy }}"
{% endif %}
{% if no_proxy %}
noProxy: "{{ no_proxy }}"
{% endif %}
{% endif %}
12 changes: 12 additions & 0 deletions agent/roles/manifests/templates/install-config_vsphere_yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,15 @@ additionalTrustBundle: {{ ca_bundle_crt }}
{% elif enable_local_registry %}
additionalTrustBundle: {{ registry_certificate }}
{% endif %}
{% if http_proxy or https_proxy or no_proxy %}
proxy:
{% if http_proxy %}
httpProxy: "{{ http_proxy }}"
{% endif %}
{% if https_proxy %}
httpsProxy: "{{ https_proxy }}"
{% endif %}
{% if no_proxy %}
noProxy: "{{ no_proxy }}"
{% endif %}
{% endif %}
12 changes: 12 additions & 0 deletions agent/roles/manifests/templates/install-config_yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,15 @@ additionalTrustBundle: {{ ca_bundle_crt }}
{% elif enable_local_registry %}
additionalTrustBundle: {{ registry_certificate }}
{% endif %}
{% if http_proxy or https_proxy or no_proxy %}
proxy:
{% if http_proxy %}
httpProxy: "{{ http_proxy }}"
{% endif %}
{% if https_proxy %}
httpsProxy: "{{ https_proxy }}"
{% endif %}
{% if no_proxy %}
noProxy: "{{ no_proxy }}"
{% endif %}
{% endif %}
3 changes: 3 additions & 0 deletions agent/roles/manifests/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ external_subnet_v6: "{{ lookup('env', 'EXTERNAL_SUBNET_V6') }}"
external_subnet_v4_prefixlen: "{{ lookup('env', 'EXTERNAL_SUBNET_V4') | ansible.utils.ipaddr('prefix') }}"
external_subnet_v6_prefixlen: "{{ lookup('env', 'EXTERNAL_SUBNET_V6') | ansible.utils.ipaddr('prefix') }}"
fips_mode: "{{ lookup('env', 'FIPS_MODE') | bool }}"
http_proxy: "{{ lookup('env', 'AGENT_HTTP_PROXY') }}"
https_proxy: "{{ lookup('env', 'AGENT_HTTPS_PROXY') }}"
image: "{{ lookup('env', 'IMAGE') }}"
ip_stack: "{{ lookup('env', 'IP_STACK') }}"
local_image_url_suffix: "{{ lookup('env', 'LOCAL_IMAGE_URL_SUFFIX') }}"
Expand All @@ -46,6 +48,7 @@ network_type: "{{ lookup('env', 'NETWORK_TYPE') }}"
num_masters: "{{ lookup('env', 'NUM_MASTERS') }}"
num_workers: "{{ lookup('env', 'NUM_WORKERS') }}"
num_extra_workers: "{{ lookup('env', 'NUM_EXTRA_WORKERS', default='0') }}"
no_proxy: "{{ lookup('env', 'AGENT_NO_PROXY') }}"
platform_type: "{{ lookup('env', 'AGENT_PLATFORM_TYPE') }}"
platform_name: "{{ lookup('env', 'AGENT_PLATFORM_NAME') }}"
provisioning_host_external_ip: "{{ lookup('env', 'PROVISIONING_HOST_EXTERNAL_IP') }}"
Expand Down

0 comments on commit 24aed67

Please sign in to comment.