File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 17
17
- include_role :
18
18
name : compute_init
19
19
tasks_from : export.yml
20
+
21
+ - hosts : proxy
22
+ gather_facts : false
23
+ tags : proxy
24
+ become : yes
25
+ tasks :
26
+ - include_role :
27
+ name : proxy
28
+ vars :
29
+ proxy_state : absent
30
+ when : proxy_remove | bool == true
Original file line number Diff line number Diff line change @@ -17,3 +17,6 @@ Define http/s proxy configuration.
17
17
- ` proxy_systemd ` : Optional bool. Whether to give processes started by systemd
18
18
the above http, https and no_proxy configuration. ** NB** Running services will
19
19
need restarting if this is changed. Default ` true ` .
20
+ - ` proxy_remove ` : Optional bool. Whether to remove the proxy configuration at
21
+ the end of the ` site.yml ` playbook (this is actually a variable on the play,
22
+ not a role variable).
Original file line number Diff line number Diff line change @@ -5,3 +5,5 @@ proxy_no_proxy_extras: []
5
5
proxy_no_proxy : " {{ (proxy_no_proxy_defaults + proxy_no_proxy_extras) | unique | sort | join(',') }}"
6
6
proxy_dnf : true
7
7
proxy_systemd : true
8
+ proxy_state : present
9
+ # proxy_remove: false
Original file line number Diff line number Diff line change
1
+ - name : Validate http_proxy definition
2
+ ansible.builtin.assert :
3
+ that : proxy_http_proxy != '' # this is default if squid not active
4
+ fail_msg : >-
5
+ Variable proxy_http_proxy cannot be the empty string for hosts in the
6
+ proxy group. See environment/common/inventory/group_vars/all/proxy.yml.
1
7
- name : Define configuration in /etc/environment
2
8
tags : proxy
3
9
lineinfile :
6
12
owner : root
7
13
group : root
8
14
mode : o=rw,go=r
9
- state : present
15
+ state : " {{ proxy_state }} "
10
16
regexp : " {{ item.key }}=.*"
11
17
line : " {{ item.key }}={{ item.value }}"
12
18
loop :
24
30
option : " proxy"
25
31
value : " {{ proxy_http_proxy }}"
26
32
no_extra_spaces : true
33
+ state : " {{ proxy_state }}"
27
34
owner : root
28
35
group : root
29
36
mode : o=rw,go=r
48
55
"https_proxy={{ proxy_http_proxy }}"
49
56
"no_proxy={{ proxy_no_proxy }}"
50
57
no_extra_spaces : true
58
+ state : " {{ proxy_state }}"
51
59
owner : root
52
60
group : root
53
61
mode : ug=rw,o=r
You can’t perform that action at this time.
0 commit comments