Support for squidclient added.

This commit is contained in:
Andrea Dell'Amico 2020-10-29 13:14:56 +01:00
parent 87a8610dbf
commit b56aeb1fc9
3 changed files with 22 additions and 2 deletions

View File

@ -1,5 +1,12 @@
--- ---
squid_install: True squid_install: True
squid_deb_packages:
- squid
- squidclient
squid_el_packages:
- squid
squid_local_nets: squid_local_nets:
- '127.0.0.1/8' - '127.0.0.1/8'
@ -10,6 +17,10 @@ squid_safe_ports:
- 80 - 80
- 443 - 443
squidclient_enabled: True
squidclient_allowed_hosts:
- '127.0.0.1/8'
squid_max_object_size: '10 MB' squid_max_object_size: '10 MB'
squid_disk_cache: '2048 16 256' squid_disk_cache: '2048 16 256'

View File

@ -1,7 +1,7 @@
--- ---
- block: - block:
- name: Install the squid package on RH based systems - name: Install the squid package on RH based systems
yum: pkg=squid state=present yum: pkg={{ squid_el_packages }} state=present
when: when:
- ansible_distribution_file_variety == "RedHat" - ansible_distribution_file_variety == "RedHat"
@ -10,7 +10,7 @@
- block: - block:
- name: Install the squid package on Debian based systems - name: Install the squid package on Debian based systems
apt: pkg=squid state=present cache_valid_time=3600 apt: pkg={{ squid_deb_packages }} state=present cache_valid_time=3600
when: when:
- ansible_distribution_file_variety == "Debian" - ansible_distribution_file_variety == "Debian"

View File

@ -19,6 +19,15 @@ acl Safe_ports port {{ port }}
acl CONNECT method CONNECT acl CONNECT method CONNECT
{% if squidclient_enabled %}
acl PURGE method PURGE
acl localhost src 127.0.0.1
{% for cidr in squidclient_allowed_hosts %}
acl squidclientnet src {{ cidr }}
{% endfor %}
http_access allow PURGE localhost
http_access allow PURGE squidclientnet
{% endif %}
# #
# Recommended minimum Access Permission configuration: # Recommended minimum Access Permission configuration:
# #