2016-03-14 02:00:12 +01:00
|
|
|
---
|
|
|
|
# Proxy and webfiltering configurations
|
|
|
|
|
|
|
|
- name: Installing proxy-related packages
|
|
|
|
yum:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
with_items:
|
|
|
|
- nethserver-squid
|
|
|
|
- nethserver-squidclamav
|
|
|
|
- nethserver-squidguard
|
|
|
|
|
|
|
|
# Squid
|
|
|
|
|
|
|
|
- name: Checking squid configuration
|
2016-03-14 02:27:07 +01:00
|
|
|
shell: /sbin/e-smith/db configuration printprop squid DiskCacheSize
|
2016-03-14 02:00:12 +01:00
|
|
|
ignore_errors: yes
|
|
|
|
register: chk_squid
|
|
|
|
changed_when: "'DiskCacheSize=2000' not in chk_squid.stdout"
|
|
|
|
|
|
|
|
- name: Configuring Squid
|
|
|
|
shell: /sbin/e-smith/db configuration setprop squid BlueMode transparent GreenMode transparent PortBlock disabled status enabled DiskCache enabled DiskCacheSize 2000
|
2019-11-18 23:19:31 +01:00
|
|
|
when: chk_squid is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
- name: Activating Squid configuration
|
|
|
|
shell: /sbin/e-smith/signal-event nethserver-squid-update
|
2019-11-18 23:19:31 +01:00
|
|
|
when: chk_squid is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
# Squid-clamav
|
|
|
|
|
|
|
|
- name: Checking squidclamav configuration
|
|
|
|
shell: /sbin/e-smith/db configuration printprop squidclamav status
|
|
|
|
ignore_errors: true
|
|
|
|
register: chk_squidclamav
|
|
|
|
changed_when: "'status=enabled' not in chk_squidclamav.stdout"
|
|
|
|
|
|
|
|
- name: Configuring squidclamav
|
|
|
|
shell: /sbin/e-smith/db configuration setprop squidclamav status enabled
|
2019-11-18 23:19:31 +01:00
|
|
|
when: chk_squidclamav is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
- name: Activating squidclamav
|
|
|
|
shell: /sbin/e-smith/signal-event nethserver-squidclamav-update
|
2019-11-18 23:19:31 +01:00
|
|
|
when: chk_squidclamav is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
# SquidGuard
|
|
|
|
|
|
|
|
- name: Verifying squidguard configuration
|
|
|
|
shell: /sbin/e-smith/db configuration printprop squidguard status
|
|
|
|
register: check_squidguard
|
2016-03-14 02:27:07 +01:00
|
|
|
ignore_errors: true
|
|
|
|
changed_when: '"status=enabled" not in check_squidguard.stdout'
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
- name: Configuring squidguard
|
|
|
|
shell: /sbin/e-smith/db configuration setprop squidguard Expressions enabled Lists shalla status enabled
|
2019-11-18 23:19:31 +01:00
|
|
|
when: check_squidguard is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
- name: Activating squidguard configuration
|
|
|
|
shell: "/sbin/e-smith/signal-event nethserver-squidguard-{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- save
|
|
|
|
- update
|
|
|
|
- downloadlists
|
2019-11-18 23:19:31 +01:00
|
|
|
when: check_squidguard is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
# Content filtering settings
|
|
|
|
|
|
|
|
- name: Verifying content filtering
|
|
|
|
shell: /sbin/e-smith/db contentfilter printprop default Categories
|
|
|
|
register: check_cf
|
2016-04-28 03:12:18 +02:00
|
|
|
changed_when: "'sex' not in check_cf.stdout"
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
- name: Configuring content filtering
|
|
|
|
shell: /sbin/e-smith/db contentfilter setprop default Categories aggressive,alcohol,weapons,games-online,gamble,dating,webradio,webtv,sex,porn,spyware,violence,anonvpn,warez
|
|
|
|
register: cf_cat
|
2019-11-18 23:19:31 +01:00
|
|
|
when: check_cf is changed
|
2016-03-14 02:00:12 +01:00
|
|
|
|
|
|
|
- name: Activating content filtering as a whole
|
|
|
|
shell: /sbin/e-smith/signal-event nethserver-squidguard-update
|
2019-11-18 23:19:31 +01:00
|
|
|
when: check_cf is changed
|