line:"{{ item }}={{ (system_proxy is defined and system_proxy != '') | ternary(system_proxy,'') }}"
state:"{{ (system_proxy is defined and system_proxy != '') | ternary('present','absent') }}"
with_items:
- http_proxy
- HTTP_PROXY
- https_proxy
- HTTPS_PROXY
- ftp_proxy
- FTP_PROXY
tags:proxy
- name:Set proxy exceptions
lineinfile:
dest:/etc/environment
regexp:"^{{ item }}=.*"
line:"{{ item }}={{ (system_proxy is defined and system_proxy != '' and system_proxy_no_proxy is defined and system_proxy_no_proxy | length > 0) | ternary(system_proxy_no_proxy | join(','),'') }}"
state:"{{ (system_proxy is defined and system_proxy != '' and system_proxy_no_proxy is defined and system_proxy_no_proxy | length > 0) | ternary('present','absent') }}"