ansible-roles/roles/system_proxy/tasks/RedHat.yml

21 lines
697 B
YAML

---
- name: Configure proxy for yum
ini_file:
path: /etc/yum.conf
section: main
option: proxy
value: "{{ (system_proxy is defined and system_proxy != '') | ternary(system_proxy,'') }}"
state: "{{ (system_proxy is defined and system_proxy != '') | ternary('present','absent') }}"
tags: proxy
- name: Configure proxy for dnf
ini_file:
path: /etc/dnf/yum.conf
section: main
option: proxy
value: "{{ (system_proxy is defined and system_proxy != '') | ternary(system_proxy,'') }}"
state: "{{ (system_proxy is defined and system_proxy != '') | ternary('present','absent') }}"
when: ansible_distribution_major_version is version('8', '>=')
tags: proxy