Skip to content

Commit

Permalink
fix(ansible): move env to inventory
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
  • Loading branch information
glimchb committed Jun 4, 2024
1 parent 08bc8e0 commit fe6c03a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions ansible/inventory
Original file line number Diff line number Diff line change
Expand Up @@ -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'}"
8 changes: 2 additions & 6 deletions ansible/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fe6c03a

Please sign in to comment.