mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-23 21:53:21 +02:00
Update to 2022-02-10 13:00
This commit is contained in:
parent
6f6d3b7382
commit
0c2892d14a
@ -4,16 +4,22 @@
|
|||||||
template: src=proxy.sh.j2 dest=/etc/profile.d/proxy.sh mode=755
|
template: src=proxy.sh.j2 dest=/etc/profile.d/proxy.sh mode=755
|
||||||
tags: proxy
|
tags: proxy
|
||||||
|
|
||||||
- name: Add lines in environment file
|
- name: Handle variables in environment file
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/environment
|
dest: /etc/environment
|
||||||
regexp: "^{{ item }}=.*"
|
regexp: "^{{ item }}=.*"
|
||||||
line: "{{ item }}={{ (system_proxy is defined and system_proxy != '') | ternary(system_proxy,'') }}"
|
line: "{{ item }}={{ (system_proxy is defined and system_proxy != '') | ternary(system_proxy,'') }}"
|
||||||
state: "{{ (system_proxy is defined and system_proxy != '') | ternary('present','absent') }}"
|
state: "{{ (system_proxy is defined and system_proxy != '' and item | lower | regex_replace('(?i)_proxy$', '') in system_proxy_proto | map('lower') ) | 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 }}"
|
loop:
|
||||||
|
- http_proxy
|
||||||
|
- HTTP_PROXY
|
||||||
|
- https_proxy
|
||||||
|
- HTTPS_PROXY
|
||||||
|
- ftp_proxy
|
||||||
|
- FTP_PROXY
|
||||||
tags: proxy
|
tags: proxy
|
||||||
|
|
||||||
- name: Set proxy exceptions
|
- name: Handle proxy exceptions in environment file
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/environment
|
dest: /etc/environment
|
||||||
regexp: "^{{ item }}=.*"
|
regexp: "^{{ item }}=.*"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{% if system_proxy is defined and system_proxy != '' %}
|
{% if system_proxy is defined and system_proxy != '' %}
|
||||||
{% for proto in system_proxy_proto %}
|
{% for proto in system_proxy_proto %}
|
||||||
export {{ proto }}_proxy={{ system_proxy }}
|
export {{ proto | lower }}_proxy={{ system_proxy }}
|
||||||
export {{ proto | upper }}_PROXY={{ system_proxy }}
|
export {{ proto | upper }}_PROXY={{ system_proxy }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
export no_proxy='{{ system_proxy_no_proxy | join(',') }}'
|
export no_proxy='{{ system_proxy_no_proxy | join(',') }}'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Manager]
|
[Manager]
|
||||||
{% if system_proxy is defined and system_proxy != '' %}
|
{% if system_proxy is defined and system_proxy != '' %}
|
||||||
DefaultEnvironment={% for proto in system_proxy_proto %}{{ proto }}_proxy={{ system_proxy }} {{ proto | upper }}_PROXY={{ system_proxy }} {% endfor %}no_proxy={{ system_proxy_no_proxy | join(',') }} NO_PROXY={{ system_proxy_no_proxy | join(',') }}
|
DefaultEnvironment={% for proto in system_proxy_proto %}{{ proto | lower }}_proxy={{ system_proxy }} {{ proto | upper }}_PROXY={{ system_proxy }} {% endfor %}no_proxy={{ system_proxy_no_proxy | join(',') }} NO_PROXY={{ system_proxy_no_proxy | join(',') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
# No proxy configured
|
# No proxy configured
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user