1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 03:32:12 +00:00
This commit is contained in:
Jerry Vonau 2022-07-08 02:04:05 -05:00
parent a9e92191db
commit bcc59a0bc3
3 changed files with 29 additions and 28 deletions

View file

@ -20,35 +20,35 @@
iiab_network_mode: "Gateway"
when: iiab_lan_iface != "none" and iiab_wan_iface != "none"
- name: No LAN configured - non-dnsmasq
set_fact:
#- name: No LAN configured - non-dnsmasq
# set_fact:
# named_enabled: True
# dhcpd_enabled: False
dhcp_service2: "dhcpd disabled"
when: not dnsmasq_enabled and iiab_network_mode == "Appliance"
# dhcp_service2: "dhcpd disabled"
# when: not dnsmasq_enabled and iiab_network_mode == "Appliance"
- name: LAN configured - non-dnsmasq
set_fact:
#- name: LAN configured - non-dnsmasq
# set_fact:
# named_enabled: True
# dhcpd_enabled: True
dhcp_service2: "dhcpd"
when: not dnsmasq_enabled and iiab_network_mode != "Appliance"
# dhcp_service2: "dhcpd"
# when: not dnsmasq_enabled and iiab_network_mode != "Appliance"
- name: LAN configured - dnsmasq
set_fact:
#- name: LAN configured - dnsmasq
# set_fact:
# named_enabled: False
# dhcpd_enabled: False
dnsmasq_enabled: True
dhcp_service2: "dnsmasq"
when: dnsmasq_install and iiab_network_mode != "Appliance"
# dnsmasq_enabled: True
# dhcp_service2: "dnsmasq"
# when: dnsmasq_install and iiab_network_mode != "Appliance"
- name: LAN not configured - dnsmasq
set_fact:
#- name: LAN not configured - dnsmasq
# set_fact:
# named_enabled: False
# dhcpd_enabled: False
dnsmasq_enabled: True
dhcp_service2: "dnsmasq"
when: dnsmasq_install and iiab_network_mode == "Appliance"
# dnsmasq_enabled: True
# dhcp_service2: "dnsmasq"
# when: dnsmasq_install and iiab_network_mode == "Appliance"
- name: Add 'network' variable values (from computed_services.yml) to {{ iiab_ini_file }}
ini_file:

View file

@ -117,13 +117,13 @@
systemd:
name: iiab-dnsmasq
enabled: yes
# when: dnsmasq_install and dnsmasq_enabled
when: dnsmasq_enabled
- name: Disable iiab-dnsmasq, if not dnsmasq_enabled
systemd:
name: iiab-dnsmasq
enabled: no
when: dnsmasq_install and not dnsmasq_enabled
when: not dnsmasq_enabled
# - name: Enable DansGuardian systemd service, if dansguardian_enabled
# systemd:
@ -142,13 +142,13 @@
path: "{{ iiab_env_file }}"
regexp: '^HTTPCACHE_ON=*'
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
systemd:
name: "{{ proxy }}" # squid (or 'squid3' on vars/debian-8.yml, vars/raspbian-8.yml)
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
template:
@ -157,7 +157,7 @@
# owner: "{{ proxy_user }}" # proxy (or 'squid' on vars/centos-7.yml, vars/fedora-18.yml, vars/fedora-12.yml)
# group: "{{ proxy_user }}"
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
# lineinfile:
@ -170,14 +170,14 @@
systemd:
name: "{{ proxy }}"
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
lineinfile:
path: "{{ iiab_env_file }}"
regexp: '^HTTPCACHE_ON=*'
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
# systemd:

View file

@ -99,11 +99,12 @@
#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
#- name: User choice of dnsmasq or dhcpd - restarting {{ dhcp_service2 }}
- name: Restarting {{ dhcp_service2 }}
- name: Restarting dnsmasq
systemd:
name: "{{ dhcp_service2 }}"
name: dnsmasq
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))
#when: (iiab_network_mode != "Appliance") # Sufficient b/c br0 exists thanks to /etc/network/interfaces.d/iiab