--- # Proxy and webfiltering configurations - name: Installing proxy-related packages yum: name: - nethserver-squid - nethserver-squidclamav - nethserver-squidguard state: present # Squid - name: Checking squid configuration shell: /sbin/e-smith/db configuration printprop squid DiskCacheSize 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 when: chk_squid|changed - name: Activating Squid configuration shell: /sbin/e-smith/signal-event nethserver-squid-save when: chk_squid|changed # SquidGuard - name: Verifying squidguard configuration shell: /sbin/e-smith/db configuration printprop squidguard status register: check_squidguard ignore_errors: true changed_when: '"status=enabled" not in check_squidguard.stdout' - name: Checking ufdb configuration shell: /sbin/e-smith/db configuration printprop ufdb status ignore_errors: true register: chk_ufdb changed_when: "'status=enabled' not in check_squidguard.stdout" - name: Configuring ufdb shell: /sbin/e-smith/db configuration setprop ufdb status enabled when: check_squidguard|changed - name: Configuring squidguard shell: /sbin/e-smith/db configuration setprop squidguard Expressions enabled Lists shalla when: check_squidguard|changed - name: Activating squidguard configuration shell: "/sbin/e-smith/signal-event nethserver-squidguard-{{ item }}" with_items: - save - downloadlists when: check_squidguard|changed # Squid-clamav - name: Checking squidclamav configuration shell: /sbin/e-smith/db configuration printprop clamd@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 clamd@squidclamav status enabled when: chk_squidclamav|changed - name: Activating squidclamav shell: /sbin/e-smith/signal-event nethserver-squidclamav-update when: chk_squidclamav|changed # Content filtering settings - name: Verifying content filtering shell: /sbin/e-smith/db contentfilter printprop default Categories register: check_cf changed_when: "'sex' not in check_cf.stdout" - 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 BlackList enabled BlockAll disabled BlockBuiltinRules disabled BlockFileTypes disabled BlockIpAccess enabled register: cf_cat when: check_cf|changed - name: Activating content filtering as a whole shell: /sbin/e-smith/signal-event nethserver-squidguard-save when: check_cf|changed