mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
cleanups
This commit is contained in:
parent
a9e92191db
commit
bcc59a0bc3
3 changed files with 29 additions and 28 deletions
|
@ -20,35 +20,35 @@
|
||||||
iiab_network_mode: "Gateway"
|
iiab_network_mode: "Gateway"
|
||||||
when: iiab_lan_iface != "none" and iiab_wan_iface != "none"
|
when: iiab_lan_iface != "none" and iiab_wan_iface != "none"
|
||||||
|
|
||||||
- name: No LAN configured - non-dnsmasq
|
#- name: No LAN configured - non-dnsmasq
|
||||||
set_fact:
|
# set_fact:
|
||||||
# named_enabled: True
|
# named_enabled: True
|
||||||
# dhcpd_enabled: False
|
# dhcpd_enabled: False
|
||||||
dhcp_service2: "dhcpd disabled"
|
# dhcp_service2: "dhcpd disabled"
|
||||||
when: not dnsmasq_enabled and iiab_network_mode == "Appliance"
|
# when: not dnsmasq_enabled and iiab_network_mode == "Appliance"
|
||||||
|
|
||||||
- name: LAN configured - non-dnsmasq
|
#- name: LAN configured - non-dnsmasq
|
||||||
set_fact:
|
# set_fact:
|
||||||
# named_enabled: True
|
# named_enabled: True
|
||||||
# dhcpd_enabled: True
|
# dhcpd_enabled: True
|
||||||
dhcp_service2: "dhcpd"
|
# dhcp_service2: "dhcpd"
|
||||||
when: not dnsmasq_enabled and iiab_network_mode != "Appliance"
|
# when: not dnsmasq_enabled and iiab_network_mode != "Appliance"
|
||||||
|
|
||||||
- name: LAN configured - dnsmasq
|
#- name: LAN configured - dnsmasq
|
||||||
set_fact:
|
# set_fact:
|
||||||
# named_enabled: False
|
# named_enabled: False
|
||||||
# dhcpd_enabled: False
|
# dhcpd_enabled: False
|
||||||
dnsmasq_enabled: True
|
# dnsmasq_enabled: True
|
||||||
dhcp_service2: "dnsmasq"
|
# dhcp_service2: "dnsmasq"
|
||||||
when: dnsmasq_install and iiab_network_mode != "Appliance"
|
# when: dnsmasq_install and iiab_network_mode != "Appliance"
|
||||||
|
|
||||||
- name: LAN not configured - dnsmasq
|
#- name: LAN not configured - dnsmasq
|
||||||
set_fact:
|
# set_fact:
|
||||||
# named_enabled: False
|
# named_enabled: False
|
||||||
# dhcpd_enabled: False
|
# dhcpd_enabled: False
|
||||||
dnsmasq_enabled: True
|
# dnsmasq_enabled: True
|
||||||
dhcp_service2: "dnsmasq"
|
# dhcp_service2: "dnsmasq"
|
||||||
when: dnsmasq_install and iiab_network_mode == "Appliance"
|
# when: dnsmasq_install and iiab_network_mode == "Appliance"
|
||||||
|
|
||||||
- name: Add 'network' variable values (from computed_services.yml) to {{ iiab_ini_file }}
|
- name: Add 'network' variable values (from computed_services.yml) to {{ iiab_ini_file }}
|
||||||
ini_file:
|
ini_file:
|
||||||
|
|
|
@ -117,13 +117,13 @@
|
||||||
systemd:
|
systemd:
|
||||||
name: iiab-dnsmasq
|
name: iiab-dnsmasq
|
||||||
enabled: yes
|
enabled: yes
|
||||||
# when: dnsmasq_install and dnsmasq_enabled
|
when: dnsmasq_enabled
|
||||||
|
|
||||||
- name: Disable iiab-dnsmasq, if not dnsmasq_enabled
|
- name: Disable iiab-dnsmasq, if not dnsmasq_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: iiab-dnsmasq
|
name: iiab-dnsmasq
|
||||||
enabled: no
|
enabled: no
|
||||||
when: dnsmasq_install and not dnsmasq_enabled
|
when: not dnsmasq_enabled
|
||||||
|
|
||||||
# - name: Enable DansGuardian systemd service, if dansguardian_enabled
|
# - name: Enable DansGuardian systemd service, if dansguardian_enabled
|
||||||
# systemd:
|
# systemd:
|
||||||
|
@ -142,13 +142,13 @@
|
||||||
path: "{{ iiab_env_file }}"
|
path: "{{ iiab_env_file }}"
|
||||||
regexp: '^HTTPCACHE_ON=*'
|
regexp: '^HTTPCACHE_ON=*'
|
||||||
line: 'HTTPCACHE_ON=True'
|
line: 'HTTPCACHE_ON=True'
|
||||||
when: squid_install and squid_enabled
|
when: squid_installed is defined and squid_enabled
|
||||||
|
|
||||||
- name: Enable systemd service '{{ proxy }}' - if squid_install and squid_enabled
|
- name: Enable systemd service '{{ proxy }}' - if squid_install and squid_enabled
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ proxy }}" # squid (or 'squid3' on vars/debian-8.yml, vars/raspbian-8.yml)
|
name: "{{ proxy }}" # squid (or 'squid3' on vars/debian-8.yml, vars/raspbian-8.yml)
|
||||||
enabled: yes
|
enabled: yes
|
||||||
when: squid_install and squid_enabled
|
when: squid_installed is defined and squid_enabled
|
||||||
|
|
||||||
- name: Install /etc/{{ proxy }}/squid.conf from template (root:root, 0644 by default) - and create a timestamped backup of the original - if squid_install and squid_enabled
|
- name: Install /etc/{{ proxy }}/squid.conf from template (root:root, 0644 by default) - and create a timestamped backup of the original - if squid_install and squid_enabled
|
||||||
template:
|
template:
|
||||||
|
@ -157,7 +157,7 @@
|
||||||
# owner: "{{ proxy_user }}" # proxy (or 'squid' on vars/centos-7.yml, vars/fedora-18.yml, vars/fedora-12.yml)
|
# owner: "{{ proxy_user }}" # proxy (or 'squid' on vars/centos-7.yml, vars/fedora-18.yml, vars/fedora-12.yml)
|
||||||
# group: "{{ proxy_user }}"
|
# group: "{{ proxy_user }}"
|
||||||
backup: yes
|
backup: yes
|
||||||
when: squid_install and squid_enabled
|
when: squid_installed is defined and squid_enabled
|
||||||
|
|
||||||
# - name: Point /etc/init.d/{{ proxy }} to /etc/{{ proxy }}/squid-iiab.conf - if squid_install and squid_enabled
|
# - name: Point /etc/init.d/{{ proxy }} to /etc/{{ proxy }}/squid-iiab.conf - if squid_install and squid_enabled
|
||||||
# lineinfile:
|
# lineinfile:
|
||||||
|
@ -170,14 +170,14 @@
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ proxy }}"
|
name: "{{ proxy }}"
|
||||||
enabled: no
|
enabled: no
|
||||||
when: (squid_install or squid_installed is defined) and not squid_enabled
|
when: squid_installed is defined and not squid_enabled
|
||||||
|
|
||||||
- name: Revert {{ iiab_env_file }} to 'HTTPCACHE_ON=False' - if squid_install and not squid_enabled
|
- name: Revert {{ iiab_env_file }} to 'HTTPCACHE_ON=False' - if squid_install and not squid_enabled
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: "{{ iiab_env_file }}"
|
path: "{{ iiab_env_file }}"
|
||||||
regexp: '^HTTPCACHE_ON=*'
|
regexp: '^HTTPCACHE_ON=*'
|
||||||
line: 'HTTPCACHE_ON=False'
|
line: 'HTTPCACHE_ON=False'
|
||||||
when: squid_install and not squid_enabled
|
when: squid_installed is defined and not squid_enabled
|
||||||
|
|
||||||
# - name: Enable Wondershaper service, if wondershaper_enabled
|
# - name: Enable Wondershaper service, if wondershaper_enabled
|
||||||
# systemd:
|
# systemd:
|
||||||
|
|
|
@ -99,11 +99,12 @@
|
||||||
#keep an eye on legacy wifi installs where br0 is present but not 'online' with an ip address
|
#keep an eye on legacy wifi installs where br0 is present but not 'online' with an ip address
|
||||||
#due to hostapd didn't go to a carrier state. All others should get dnsmasq restarted
|
#due to hostapd didn't go to a carrier state. All others should get dnsmasq restarted
|
||||||
#- name: User choice of dnsmasq or dhcpd - restarting {{ dhcp_service2 }}
|
#- name: User choice of dnsmasq or dhcpd - restarting {{ dhcp_service2 }}
|
||||||
- name: Restarting {{ dhcp_service2 }}
|
- name: Restarting dnsmasq
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ dhcp_service2 }}"
|
name: dnsmasq
|
||||||
state: restarted
|
state: restarted
|
||||||
when: (not no_net_restart or (is_ubuntu and wifi_up_down)) or (iiab_stage|int == 9)
|
when: dnsmasq_enabled and ((not no_net_restart or (is_ubuntu and wifi_up_down)) or (iiab_stage|int == 9))
|
||||||
|
# when: (not no_net_restart or (is_ubuntu and wifi_up_down)) or (iiab_stage|int == 9)
|
||||||
#when: (not no_net_restart or (is_ubuntu_20 and wifi_up_down)) or (iiab_stage|int == 9)
|
#when: (not no_net_restart or (is_ubuntu_20 and wifi_up_down)) or (iiab_stage|int == 9)
|
||||||
#when: (not no_net_restart or (is_ubuntu_20 and wifi_up_down))
|
#when: (not no_net_restart or (is_ubuntu_20 and wifi_up_down))
|
||||||
#when: (iiab_network_mode != "Appliance") # Sufficient b/c br0 exists thanks to /etc/network/interfaces.d/iiab
|
#when: (iiab_network_mode != "Appliance") # Sufficient b/c br0 exists thanks to /etc/network/interfaces.d/iiab
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue