diff --git a/ansible/inventory b/ansible/inventory index fc7cb88..a4761cb 100644 --- a/ansible/inventory +++ b/ansible/inventory @@ -35,3 +35,6 @@ mgmt ansible_host=172.22.0.1 ansible_connection=ssh ansible_user=root [switches] ToR ansible_host=172.22.0.5 ansible_connection=ansible.netcommon.network_cli ansible_user=arista ansible_ssh_pass=arista ansible_network_os=arista.eos.eos A100G ansible_host=172.22.1.250 ansible_connection=ansible.netcommon.network_cli ansible_user=arista ansible_ssh_pass=arista ansible_network_os=arista.eos.eos + +[mev:vars] +proxy_env="{'http_proxy': 'http://192.168.0.1:3128', 'https_proxy': 'http://192.168.0.1:3128'}" 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