Proxy: add a variable with the java parameters.

This commit is contained in:
Andrea Dell'Amico 2020-07-03 16:46:24 +02:00
parent c24276591f
commit 12104026c1
2 changed files with 12 additions and 5 deletions

View File

@ -1,12 +1,18 @@
---
- name: Proxy in the global shell environment
block:
- name: Install the proxy environment file
template: src=10-caching-proxy.sh.j2 dest=/etc/profile.d/10-caching-proxy.sh owner=root group=root mode=0444
when: enable_env_proxy | bool
- name: Install the proxy environment files
template: src={{ item }}.j2 dest=/etc/profile.d/{{ item }} owner=root group=root mode=0444
with_items:
- 10-caching-proxy.sh
- 10-java-caching-proxy.sh
when: enable_env_proxy
- name: Remove the proxy environment file if not required
file: dest=/etc/profile.d/10-caching-proxy.sh state=absent
when: not enable_env_proxy | bool
file: dest=/etc/profile.d/{{ item }} state=absent
with_items:
- 10-caching-proxy.sh
- 10-java-caching-proxy.sh
when: not enable_env_proxy
tags: [ 'systemsetup', 'proxyenv' ]

View File

@ -0,0 +1 @@
export JAVA_OPTS='-DproxySet=true -Dhttp.proxyHost={{ env_proxy_http_host }} -Dhttp.proxyPort={{ env_proxy_http_port }} -Dhttps.proxyHost={{ env_proxy_http_host }} -Dhttps.proxyPort={{ env_proxy_http_port }} -Dhttp.nonProxyHosts="{% for noproxy_h in no_proxy_target %}{{ noproxy_h }}{% if not loop.last %}|{% endif %}{% endfor %}" $JAVA_OPTS'