diff --git a/agent/05_agent_configure.sh b/agent/05_agent_configure.sh index 35f389977..ed0c4655d 100755 --- a/agent/05_agent_configure.sh +++ b/agent/05_agent_configure.sh @@ -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} \ diff --git a/agent/roles/manifests/templates/install-config_baremetal_yaml.j2 b/agent/roles/manifests/templates/install-config_baremetal_yaml.j2 index 32f59a819..7b1013e85 100644 --- a/agent/roles/manifests/templates/install-config_baremetal_yaml.j2 +++ b/agent/roles/manifests/templates/install-config_baremetal_yaml.j2 @@ -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 %} \ No newline at end of file diff --git a/agent/roles/manifests/templates/install-config_vsphere_yaml.j2 b/agent/roles/manifests/templates/install-config_vsphere_yaml.j2 index 861eb2ce8..8a39f8256 100644 --- a/agent/roles/manifests/templates/install-config_vsphere_yaml.j2 +++ b/agent/roles/manifests/templates/install-config_vsphere_yaml.j2 @@ -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 %} \ No newline at end of file diff --git a/agent/roles/manifests/templates/install-config_yaml.j2 b/agent/roles/manifests/templates/install-config_yaml.j2 index a3508b6eb..f956eb9d2 100644 --- a/agent/roles/manifests/templates/install-config_yaml.j2 +++ b/agent/roles/manifests/templates/install-config_yaml.j2 @@ -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 %} \ No newline at end of file diff --git a/agent/roles/manifests/vars/main.yml b/agent/roles/manifests/vars/main.yml index 8ebaf43d2..b6cbc8800 100644 --- a/agent/roles/manifests/vars/main.yml +++ b/agent/roles/manifests/vars/main.yml @@ -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') }}" @@ -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') }}"