From 5d1a35d25e30a6d8b2d509e9d343e4528883e930 Mon Sep 17 00:00:00 2001 From: Boris Glimcher Date: Tue, 4 Jun 2024 13:12:57 +0300 Subject: [PATCH] fix(ansible): move env to inventory Signed-off-by: Boris Glimcher --- ansible/inventory | 3 +++ ansible/setup.yml | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) 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..4798ad5 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'