mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge branch 'master' into wifi_info
This commit is contained in:
commit
a643df2595
51 changed files with 243 additions and 184 deletions
|
|
@ -70,9 +70,14 @@
|
|||
mode: 0600
|
||||
when: wan_ip != "dhcp"
|
||||
|
||||
- name: Use systemd-networkd to handle br0
|
||||
include_tasks: sysd-netd-debian.yml
|
||||
when: iiab_lan_iface == "br0" and not systemd_networkd_active
|
||||
|
||||
- name: Reload systemd
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
when: not iiab_lan_iface == "br0"
|
||||
|
||||
- name: Restart the NetworkManager service
|
||||
systemd:
|
||||
|
|
|
|||
|
|
@ -57,33 +57,39 @@
|
|||
option: "{{ item.option }}"
|
||||
value: "{{ item.value | string }}"
|
||||
with_items:
|
||||
- option: dansguardian_enabled
|
||||
value: "{{ dansguardian_enabled }}"
|
||||
- option: squid_enabled
|
||||
value: "{{ squid_enabled }}"
|
||||
- option: wondershaper_enabled
|
||||
value: "{{ wondershaper_enabled }}"
|
||||
- option: iiab_network_mode_applied
|
||||
value: "{{ iiab_network_mode }}"
|
||||
- option: dhcpd_enabled
|
||||
value: "{{ dhcpd_enabled }}"
|
||||
- option: dhcp_service2
|
||||
value: "{{ dhcp_service2 }}"
|
||||
- option: named_enabled
|
||||
value: "{{ named_enabled }}"
|
||||
- option: dnsmasq_enabled
|
||||
value: "{{ dnsmasq_enabled }}"
|
||||
- option: no_net_restart
|
||||
value: "{{ no_net_restart }}"
|
||||
- option: hostapd_enabled
|
||||
value: "{{ hostapd_enabled }}"
|
||||
- option: host_ssid
|
||||
value: "{{ host_ssid }}"
|
||||
- option: host_wifi_mode
|
||||
value: "{{ host_wifi_mode }}"
|
||||
- option: host_channel
|
||||
value: "{{ host_channel }}"
|
||||
|
||||
#- option: squid_install
|
||||
# value: "{{ squid_install }}"
|
||||
#- option: squid_enabled
|
||||
# value: "{{ squid_enabled }}"
|
||||
#- option: dansguardian_install
|
||||
# value: "{{ dansguardian_install }}"
|
||||
#- option: dansguardian_enabled
|
||||
# value: "{{ dansguardian_enabled }}"
|
||||
#- option: wondershaper_install
|
||||
# value: "{{ wondershaper_install }}"
|
||||
#- option: wondershaper_enabled
|
||||
# value: "{{ wondershaper_enabled }}"
|
||||
- option: iiab_network_mode_applied
|
||||
value: "{{ iiab_network_mode }}"
|
||||
- option: dhcpd_enabled
|
||||
value: "{{ dhcpd_enabled }}"
|
||||
- option: dhcp_service2
|
||||
value: "{{ dhcp_service2 }}"
|
||||
- option: named_enabled
|
||||
value: "{{ named_enabled }}"
|
||||
- option: dnsmasq_enabled
|
||||
value: "{{ dnsmasq_enabled }}"
|
||||
- option: no_net_restart
|
||||
value: "{{ no_net_restart }}"
|
||||
- option: hostapd_enabled
|
||||
value: "{{ hostapd_enabled }}"
|
||||
- option: host_ssid
|
||||
value: "{{ host_ssid }}"
|
||||
- option: host_wifi_mode
|
||||
value: "{{ host_wifi_mode }}"
|
||||
- option: host_channel
|
||||
value: "{{ host_channel }}"
|
||||
|
||||
- name: Add 'network' variable 'current_client_channel' value if defined, to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
dest: "{{ iiab_ini_file }}"
|
||||
|
|
@ -93,4 +99,4 @@
|
|||
with_items:
|
||||
- option: client_wifi_channel
|
||||
value: "{{ current_client_channel.stdout }}"
|
||||
when: current_client_channel.stdout is defined
|
||||
when: current_client_channel.stdout is defined
|
||||
|
|
@ -48,6 +48,13 @@
|
|||
state: directory
|
||||
when: ansible_distribution == "CentOS"
|
||||
|
||||
|
||||
# RECORD DansGuardian AS INSTALLED
|
||||
|
||||
- name: "Set 'dansguardian_installed: True'"
|
||||
set_fact:
|
||||
dansguardian_installed: True
|
||||
|
||||
- name: "Add 'dansguardian_installed: True' to {{ iiab_state_file }}"
|
||||
lineinfile:
|
||||
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@
|
|||
- gateway/iiab-internet-on
|
||||
- gateway/iiab-internet-off
|
||||
|
||||
|
||||
- name: Add 'squid' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
path: "{{ iiab_ini_file }}"
|
||||
|
|
@ -223,8 +224,11 @@
|
|||
option: "{{ item.option }}"
|
||||
value: "{{ item.value | string }}"
|
||||
with_items:
|
||||
- option: enabled
|
||||
- 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:
|
||||
|
|
@ -233,8 +237,11 @@
|
|||
option: "{{ item.option }}"
|
||||
value: "{{ item.value | string }}"
|
||||
with_items:
|
||||
- option: enabled
|
||||
- option: dansguardian_install
|
||||
value: "{{ dansguardian_install }}"
|
||||
- option: dansguardian_enabled
|
||||
value: "{{ dansguardian_enabled }}"
|
||||
when: dansguardian_installed is defined
|
||||
|
||||
- name: Add 'wondershaper' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
|
|
@ -243,5 +250,8 @@
|
|||
option: "{{ item.option }}"
|
||||
value: "{{ item.value | string }}"
|
||||
with_items:
|
||||
- option: enabled
|
||||
- option: wondershaper_install
|
||||
value: "{{ wondershaper_install }}"
|
||||
- option: wondershaper_enabled
|
||||
value: "{{ wondershaper_enabled }}"
|
||||
when: wondershaper_installed is defined
|
||||
|
|
|
|||
|
|
@ -23,17 +23,19 @@
|
|||
- systemd-networkd-wait-online
|
||||
when: systemd_networkd_active
|
||||
|
||||
- name: Unmask and enable the systemd-networkd service for br0
|
||||
systemd:
|
||||
name: systemd-networkd
|
||||
enabled: yes
|
||||
masked: no
|
||||
when: network_manager_active and iiab_lan_iface == "br0"
|
||||
# Moved to NM-debian.yml 2020-12-07
|
||||
#- name: Unmask and enable the systemd-networkd service for br0
|
||||
# systemd:
|
||||
# name: systemd-networkd
|
||||
# enabled: yes
|
||||
# masked: no
|
||||
# when: network_manager_active and iiab_lan_iface == "br0"
|
||||
|
||||
- name: Ensure systemd-networkd gets enabled for br0
|
||||
set_fact:
|
||||
systemd_networkd_active: True
|
||||
when: network_manager_active and iiab_lan_iface == "br0"
|
||||
# Moved to NM-debian.yml 2020-12-07
|
||||
#- name: Ensure systemd-networkd gets enabled for br0
|
||||
# set_fact:
|
||||
# systemd_networkd_active: True
|
||||
# when: network_manager_active and iiab_lan_iface == "br0"
|
||||
|
||||
# ICO will always set gui_static_wan_ip away from the default of 'unset' while
|
||||
# gui_static_wan turns dhcp on/off through wan_ip in computed_network and
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
command: /usr/bin/iiab-gen-iptables
|
||||
|
||||
- name: Checking if WiFi slave is active
|
||||
shell: brctl show br0 | grep {{ iiab_wireless_lan_iface }} | wc -l
|
||||
shell: bridge -d link | grep {{ iiab_wireless_lan_iface }} | wc -l
|
||||
# when: hostapd_enabled and discovered_wireless_iface != iiab_wan_iface and iiab_lan_iface == "br0"
|
||||
when: hostapd_enabled and iiab_lan_iface == "br0"
|
||||
register: wifi_slave
|
||||
|
|
|
|||
|
|
@ -77,15 +77,24 @@
|
|||
mode: '0750'
|
||||
state: directory
|
||||
|
||||
|
||||
- include_tasks: roles/network/tasks/dansguardian.yml
|
||||
when: dansguardian_install
|
||||
|
||||
|
||||
# RECORD Squid AS INSTALLED
|
||||
|
||||
- name: "Set 'squid_installed: True'"
|
||||
set_fact:
|
||||
squid_installed: True
|
||||
|
||||
- name: "Add 'squid_installed: True' to {{ iiab_state_file }}"
|
||||
lineinfile:
|
||||
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
||||
regexp: '^squid_installed'
|
||||
line: 'squid_installed: True'
|
||||
|
||||
|
||||
# {{ proxy }} is normally "squid", but is "squid3" on raspbian-8 & debian-8
|
||||
- name: Add '{{ proxy }}' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
|
|
@ -98,7 +107,9 @@
|
|||
value: Squid
|
||||
- option: description
|
||||
value: '"Squid caches web pages the first time they are accessed, and pulls them from the cache thereafter."'
|
||||
- option: enabled
|
||||
- option: squid_install
|
||||
value: "{{ squid_install }}"
|
||||
- option: squid_enabled
|
||||
value: "{{ squid_enabled }}"
|
||||
|
||||
- name: Add 'dansguardian' variable values to {{ iiab_ini_file }}
|
||||
|
|
@ -112,5 +123,7 @@
|
|||
value: DansGuardian
|
||||
- option: description
|
||||
value: '"DansGuardian searches web content for objectionable references and denies access when found."'
|
||||
- option: enabled
|
||||
- option: dansguardian_install
|
||||
value: "{{ dansguardian_install }}"
|
||||
- option: dansguardian_enabled
|
||||
value: "{{ dansguardian_enabled }}"
|
||||
|
|
|
|||
|
|
@ -57,10 +57,19 @@
|
|||
state: started
|
||||
when: wifi_up_down and discovered_wireless_iface != "none"
|
||||
|
||||
- name: Restart the systemd-networkd service
|
||||
- name: Enable & Restart systemd-networkd.service
|
||||
systemd:
|
||||
name: systemd-networkd
|
||||
state: restarted
|
||||
enabled: yes
|
||||
masked: no
|
||||
|
||||
- name: Enable & Restart networkd-dispatcher.service
|
||||
systemd:
|
||||
name: networkd-dispatcher
|
||||
state: restarted
|
||||
enabled: yes
|
||||
masked: no
|
||||
|
||||
- name: Restart hostapd when WiFi is present but not when using WiFi as gateway with wifi_up_down False
|
||||
systemd:
|
||||
|
|
|
|||
|
|
@ -38,12 +38,20 @@
|
|||
# group: root
|
||||
state: link
|
||||
|
||||
|
||||
# RECORD Wondershaper AS INSTALLED
|
||||
|
||||
- name: "Set 'wondershaper_installed: True'"
|
||||
set_fact:
|
||||
wondershaper_installed: True
|
||||
|
||||
- name: "Add 'wondershaper_installed: True' to {{ iiab_state_file }}"
|
||||
lineinfile:
|
||||
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
||||
regexp: '^wondershaper_installed'
|
||||
line: 'wondershaper_installed: True'
|
||||
|
||||
|
||||
- name: Add 'wondershaper' variable values to {{ iiab_ini_file }}
|
||||
ini_file:
|
||||
dest: "{{ iiab_ini_file }}"
|
||||
|
|
@ -55,5 +63,7 @@
|
|||
value: wondershaper
|
||||
- option: description
|
||||
value: '"Wondershaper is a command line tool to set maximum transfer rates for network adapters."'
|
||||
- option: enabled
|
||||
- option: wondershaper_install
|
||||
value: "{{ wondershaper_install }}"
|
||||
- option: wondershaper_enabled
|
||||
value: "{{ wondershaper_enabled }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue