1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Reinstate Squid, cutting out DansGuardian

This commit is contained in:
root 2021-08-15 07:59:35 -04:00
parent 0d0a81352c
commit 724f64e85a
18 changed files with 104 additions and 104 deletions

View file

@ -1,7 +1,7 @@
- name: No LAN configured - 'Appliance' mode
set_fact:
# dansguardian_enabled: False
# squid_enabled: False
squid_enabled: False
# wondershaper_enabled: False
hostapd_enabled: False
iiab_network_mode: "Appliance"
@ -10,7 +10,7 @@
- name: LAN configured - 'LanController' mode
set_fact:
# dansguardian_enabled: False
# squid_enabled: False
squid_enabled: False
# wondershaper_enabled: False
iiab_network_mode: "LanController"
when: iiab_lan_iface != "none" and iiab_wan_iface == "none"

View file

@ -134,55 +134,55 @@
# enabled: no
# when: (dansguardian_install or dansguardian_installed is defined) and not dansguardian_enabled
# - name: Mandate 'HTTPCACHE_ON=True' in {{ iiab_env_file }}, if squid_enabled
# lineinfile:
# path: "{{ iiab_env_file }}"
# regexp: '^HTTPCACHE_ON=*'
# line: 'HTTPCACHE_ON=True'
# state: present
# when: squid_install and squid_enabled
- name: Mandate 'HTTPCACHE_ON=True' in {{ iiab_env_file }}, if squid_enabled
lineinfile:
path: "{{ iiab_env_file }}"
regexp: '^HTTPCACHE_ON=*'
line: 'HTTPCACHE_ON=True'
state: present
when: squid_install and squid_enabled
# - name: Enable Squid systemd service ({{ proxy }}) if squid_enabled
# systemd:
# name: "{{ proxy }}"
# enabled: yes
# when: squid_install and squid_enabled
- name: Enable Squid systemd service ({{ proxy }}) if squid_enabled
systemd:
name: "{{ proxy }}"
enabled: yes
when: squid_install and squid_enabled
# - name: Install /etc/{{ proxy }}/squid-iiab.conf from template, owned by {{ proxy_user }}:{{ proxy_user }}
# template:
# src: "{{ item.src }}"
# dest: "{{ item.dest }}"
# owner: "{{ item.owner }}"
# group: "{{ item.group }}"
# mode: "{{ item.mode }}"
# with_items:
# - src: squid/squid-iiab.conf.j2
# dest: "/etc/{{ proxy }}/squid-iiab.conf"
# owner: "{{ proxy_user }}"
# group: "{{ proxy_user }}"
# mode: 0644
# when: squid_install and squid_enabled
- name: Install /etc/{{ proxy }}/squid-iiab.conf from template, owned by {{ proxy_user }}:{{ proxy_user }}
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ item.owner }}"
group: "{{ item.group }}"
mode: "{{ item.mode }}"
with_items:
- src: squid/squid-iiab.conf.j2
dest: "/etc/{{ proxy }}/squid-iiab.conf"
owner: "{{ proxy_user }}"
group: "{{ proxy_user }}"
mode: 0644
when: squid_install and squid_enabled
# - name: Point to Squid config file from startup file, if squid_enabled (debuntu)
# lineinfile:
# regexp: '^CONFIG'
# line: "CONFIG=/etc/{{ proxy }}/squid-iiab.conf"
# path: "/etc/init.d/{{ proxy }}"
# when: squid_install and squid_enabled and is_debuntu
- name: Point to Squid config file from startup file, if squid_enabled (debuntu)
lineinfile:
regexp: '^CONFIG'
line: "CONFIG=/etc/{{ proxy }}/squid-iiab.conf"
path: "/etc/init.d/{{ proxy }}"
when: squid_install and squid_enabled and is_debuntu
# - name: Disable Squid service, if not squid_enabled
# systemd:
# name: "{{ proxy }}"
# enabled: no
# when: (squid_install or squid_installed is defined) and not squid_enabled
- name: Disable Squid service, if not squid_enabled
systemd:
name: "{{ proxy }}"
enabled: no
when: (squid_install or squid_installed is defined) and not squid_enabled
# - name: Revert to 'HTTPCACHE_ON=False' if not squid_enabled
# lineinfile:
# path: "{{ iiab_env_file }}"
# regexp: '^HTTPCACHE_ON=*'
# line: 'HTTPCACHE_ON=False'
# state: present
# when: squid_install and not squid_enabled
- name: Revert to 'HTTPCACHE_ON=False' if not squid_enabled
lineinfile:
path: "{{ iiab_env_file }}"
regexp: '^HTTPCACHE_ON=*'
line: 'HTTPCACHE_ON=False'
state: present
when: squid_install and not squid_enabled
# - name: Enable Wondershaper service, if wondershaper_enabled
# systemd:
@ -217,18 +217,18 @@
- gateway/iiab-internet-off
# - name: Add 'squid' variable values to {{ iiab_ini_file }}
# ini_file:
# path: "{{ iiab_ini_file }}"
# section: squid
# option: "{{ item.option }}"
# value: "{{ item.value | string }}"
# with_items:
# - option: squid_install
# value: "{{ squid_install }}"
# - option: squid_enabled
# value: "{{ squid_enabled }}"
# when: squid_installed is defined
- name: Add 'squid' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"
section: squid
option: "{{ item.option }}"
value: "{{ item.value | string }}"
with_items:
- option: squid_install
value: "{{ squid_install }}"
- option: squid_enabled
value: "{{ squid_enabled }}"
when: squid_installed is defined
# - name: Add 'dansguardian' variable values to {{ iiab_ini_file }}
# ini_file:

View file

@ -33,9 +33,9 @@
include_tasks: dhcpd.yml
when: dhcpd_install and FQDN_changed and iiab_stage|int == 9
# - name: (Re)Install Squid
# include_tasks: squid.yml
# when: squid_install and FQDN_changed and iiab_stage|int == 9
- name: (Re)Install Squid
include_tasks: squid.yml
when: squid_install and FQDN_changed and iiab_stage|int == 9
#preprep for backends
- name: Netplan in use on Ubuntu 18.04+

View file

@ -16,12 +16,12 @@
state: restarted
when: named_enabled and named_install
# - name: Stop Squid service
# systemd:
# name: "{{ proxy }}"
# state: stopped
# async: 120
# when: squid_install or squid_installed is defined
- name: Stop Squid service
systemd:
name: "{{ proxy }}"
state: stopped
async: 120
when: squid_install or squid_installed is defined
# - name: Stop DansGuardian
# systemd:
@ -35,12 +35,12 @@
# state: restarted
# when: dansguardian_enabled and dansguardian_install and ( not is_ubuntu and iiab_stage|int < 4 )
# # Squid get re-loaded with dispatcher.d
# - name: Restart Squid service ({{ proxy }})
# systemd:
# name: "{{ proxy }}"
# state: restarted
# when: squid_enabled and squid_install
# Squid get re-loaded with dispatcher.d
- name: Restart Squid service ({{ proxy }})
systemd:
name: "{{ proxy }}"
state: restarted
when: squid_enabled and squid_install
# - name: Restart Wondershaper service (wondershaper)
# systemd:

View file

@ -78,8 +78,8 @@
state: directory
- include_tasks: roles/network/tasks/dansguardian.yml
when: dansguardian_install
# - include_tasks: roles/network/tasks/dansguardian.yml
# when: dansguardian_install
# RECORD Squid AS INSTALLED
@ -112,18 +112,18 @@
- option: squid_enabled
value: "{{ squid_enabled }}"
- name: Add 'dansguardian' variable values to {{ iiab_ini_file }}
ini_file:
dest: "{{ iiab_ini_file }}"
section: dansguardian
option: "{{ item.option }}"
value: "{{ item.value | string }}"
with_items:
- option: name
value: DansGuardian
- option: description
value: '"DansGuardian searches web content for objectionable references and denies access when found."'
- option: dansguardian_install
value: "{{ dansguardian_install }}"
- option: dansguardian_enabled
value: "{{ dansguardian_enabled }}"
# - name: Add 'dansguardian' variable values to {{ iiab_ini_file }}
# ini_file:
# dest: "{{ iiab_ini_file }}"
# section: dansguardian
# option: "{{ item.option }}"
# value: "{{ item.value | string }}"
# with_items:
# - option: name
# value: DansGuardian
# - option: description
# value: '"DansGuardian searches web content for objectionable references and denies access when found."'
# - option: dansguardian_install
# value: "{{ dansguardian_install }}"
# - option: dansguardian_enabled
# value: "{{ dansguardian_enabled }}"

View file

@ -4,11 +4,11 @@
###############################
# Network Interface
{% if dansguardian_enabled %}
http_port 127.0.0.1:3130
{% else %}
# {% if dansguardian_enabled %}
# http_port 127.0.0.1:3130
# {% else %}
http_port 0.0.0.0:3128 transparent
{% endif %}
# {% endif %}
icp_port 0