Skip to content

Commit b176102

Browse files
committed
add proxy_plays_only
1 parent 788cdc1 commit b176102

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

ansible/roles/proxy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Define http/s proxy configuration.
99
- `proxy_no_proxy_extra`: Optional. List of additional addresses not to proxy. Will be combined with default list which includes `inventory_hostname` (for hostnames) and `ansible_host` (for host IPs) for all Ansible hosts.
1010
- `proxy_dnf`: Optional bool. Whether to configure yum/dnf proxying through `proxy_http_proxy`. Default `true`.
1111
- `proxy_systemd`: Optional bool. Whether to give processes started by systemd the above http, https and no_proxy configuration. **NB** Running services will need restarting if this is changed. Default `true`.
12+
- `proxy_plays_only`: TODO

ansible/roles/proxy/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ proxy_no_proxy_extras: []
55
proxy_no_proxy: "{{ (proxy_no_proxy_defaults + proxy_no_proxy_extras) | unique | sort | join(',') }}"
66
proxy_dnf: true
77
proxy_systemd: true
8+
proxy_plays_only: false

ansible/roles/proxy/tasks/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
state: present
1010
regexp: "{{ item.key }}=.*"
1111
line: "{{ item.key }}={{ item.value }}"
12+
when: not proxy_plays_only | bool
1213
loop:
1314
- key: http_proxy
1415
value: "{{ proxy_http_proxy }}"
@@ -63,3 +64,13 @@
6364
- name: Reset connection to get new /etc/environment
6465
meta: reset_connection
6566
# NB: conditionals not supported
67+
68+
- name: Add proxy vars to appliances_environment_vars
69+
set_fact:
70+
appliances_environment_vars: "{{ appliances_environment_vars | combine(_proxy_vars) }}"
71+
vars:
72+
_proxy_vars:
73+
http_proxy: "{{ proxy_http_proxy }}"
74+
https_proxy: "{{ proxy_https_proxy }}"
75+
no_proxy: "{{ proxy_no_proxy }}"
76+
when: proxy_plays_only | bool

0 commit comments

Comments
 (0)