Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- name: Gather facts on all nodes
hosts: allnodes
become: true
tasks:
- name: Gather facts on the node
debug:
msg: "IPv4: {{ansible_default_ipv4.address }}, IPv6: {{ansible_default_ipv6.address }}"
- name: Squid proxy deployment
hosts: ingress[0]
become: true
tasks:
- name: Install squid
package:
name: squid
# full-fledge restart needed to build cache
notify: Restart squid
# https://cvmfs.readthedocs.io/en/stable/cpt-squid.html
- name: Configure squid
lineinfile:
regexp: '^\s*{{ item.key }}\s+.*'
line: "{{ item.key }} {{ item.value }}"
path: /etc/squid/squid.conf
loop: "{{ config | dict2items }}"
vars:
config:
collapsed_forwarding: "on"
minimum_expiry_time: 0
maximum_object_size: 1024 MB
cache_mem: 128 MB
maximum_object_size_in_memory: 128 KB
cache_dir: ufs /var/spool/squid 81920 16 256
notify: Reload squid
- name: Configure squid - ACL allcluster
template:
src: templates/etc/squid/conf.d/allcluster.conf
dest: /etc/squid/conf.d/allcluster.conf
mode: 0644
notify: Reload squid
handlers:
- name: Restart squid
service:
name: squid
state: restarted
- name: Reload squid
service:
name: squid
state: reloaded