Skip to content

Commit 89461e4

Browse files
committed
automatically disable proxyuing dnf and systemd when proxy_plays_only
1 parent ddcd0f0 commit 89461e4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ansible/roles/proxy/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Define http/s proxy configuration.
77
- `proxy_http_proxy`: Required. Address of http proxy. E.g. "http://10.1.0.28:3128" for a Squid proxy on default port.
88
- `proxy_https_proxy`: Optional. Address of https proxy. Default is `{{ proxy_http_proxy }}`.
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.
10-
- `proxy_dnf`: Optional bool. Whether to configure yum/dnf proxying through `proxy_http_proxy`. Default `true`.
11-
- `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
10+
- `proxy_plays_only`: Optional bool. Whether to configure proxying only for Ansible plays (via the [environment](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_environment.html) keyword). Default `false` which means proxy configuration is written to the host and available to all users. If `true` this role must be run in the playbook for proxying to be available as it sets host facts.
11+
- `proxy_dnf`: Optional bool. Whether to configure yum/dnf proxying through `proxy_http_proxy`. Default `true` unless `proxy_plays_only` is `true`.
12+
- `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` unless `proxy_plays_only` is `true`.

ansible/roles/proxy/defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ proxy_https_proxy: "{{ proxy_http_proxy }}"
33
proxy_no_proxy_defaults: "{{ ['localhost', '127.0.0.1'] + groups['all'] + hostvars.values() | map(attribute='ansible_host') }}"
44
proxy_no_proxy_extras: []
55
proxy_no_proxy: "{{ (proxy_no_proxy_defaults + proxy_no_proxy_extras) | unique | sort | join(',') }}"
6-
proxy_dnf: true
7-
proxy_systemd: true
86
proxy_plays_only: false
7+
proxy_dnf: "{{ not proxy_plays_only }}"
8+
proxy_systemd: "{{ not proxy_plays_only }}"

0 commit comments

Comments
 (0)