diff --git a/ansible/inventory b/ansible/inventory index fc7cb88..464dffb 100644 --- a/ansible/inventory +++ b/ansible/inventory @@ -16,7 +16,7 @@ dh4bmc ansible_host=172.22.2.4 ansible_connection=local ansible_user=root amd ansible_host=172.22.3.1 ansible_connection=ssh ansible_user=root bf2 ansible_host=172.22.3.2 ansible_connection=ssh ansible_user=root mrv ansible_host=172.22.3.3 ansible_connection=ssh ansible_user=root -mev ansible_host=192.168.0.2 ansible_connection=ssh ansible_user=root ansible_ssh_common_args='-J root@172.22.4.4' +mev ansible_host=192.168.0.2 ansible_connection=ssh ansible_user=root ansible_ssh_common_args='-J root@172.22.4.4' proxy_env="{'http_proxy': 'http://192.168.0.1:3128', 'https_proxy': 'http://192.168.0.1:3128'}" [dpubmcs] bf2bmc ansible_host=172.22.4.2 ansible_connection=local ansible_user=root diff --git a/ansible/setup.yml b/ansible/setup.yml index e11d63d..d5f04e7 100644 --- a/ansible/setup.yml +++ b/ansible/setup.yml @@ -77,9 +77,7 @@ - name: Install docker and other packages hosts: hostservers,tgens,DPUs,Management become: yes - environment: - http_proxy: "{{ 'http://192.168.0.1:3128' if inventory_hostname == 'mev' else '' }}" - https_proxy: "{{ 'http://192.168.0.1:3128' if inventory_hostname == 'mev' else '' }}" + environment: "{{ proxy_env | default({}) }}" tasks: - ansible.builtin.package: state=present name=python3-pip,sshpass,git - when: ansible_os_family == 'Debian' @@ -137,9 +135,7 @@ - name: Intel | telegraf otel monitoring when: inventory_hostname == 'mev' - environment: - http_proxy: http://192.168.0.1:3128 - https_proxy: http://192.168.0.1:3128 + environment: "{{ proxy_env | default({}) }}" block: - name: Intel | Downgrade requests package due to bug https://github.com/ansible-collections/community.docker/issues/868 ansible.builtin.pip: name=requests<2.32