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

21 lines
697 B
YAML
Raw Normal View History

2022-02-09 17:00:06 +01:00
---
- 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