mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-26 15:55:56 +02:00
Update to 2022-02-10 13:00
This commit is contained in:
@@ -4,16 +4,22 @@
|
||||
template: src=proxy.sh.j2 dest=/etc/profile.d/proxy.sh mode=755
|
||||
tags: proxy
|
||||
|
||||
- name: Add lines in environment file
|
||||
- name: Handle variables in environment file
|
||||
lineinfile:
|
||||
dest: /etc/environment
|
||||
regexp: "^{{ item }}=.*"
|
||||
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: "{{ system_proxy_proto | map('regex_replace', '^(.*)$', '\\1_proxy') | list }} + {{ system_proxy_proto | map('regex_replace', '^(.*)$', '\\1_proxy') | map('upper') | list }}"
|
||||
state: "{{ (system_proxy is defined and system_proxy != '' and item | lower | regex_replace('(?i)_proxy$', '') in system_proxy_proto | map('lower') ) | ternary('present','absent') }}"
|
||||
loop:
|
||||
- http_proxy
|
||||
- HTTP_PROXY
|
||||
- https_proxy
|
||||
- HTTPS_PROXY
|
||||
- ftp_proxy
|
||||
- FTP_PROXY
|
||||
tags: proxy
|
||||
|
||||
- name: Set proxy exceptions
|
||||
- name: Handle proxy exceptions in environment file
|
||||
lineinfile:
|
||||
dest: /etc/environment
|
||||
regexp: "^{{ item }}=.*"
|
||||
|
Reference in New Issue
Block a user