From a349ff28c1d0fb22cdef8af7e07f37c96406df8e Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 27 Dec 2017 15:06:29 -0500 Subject: [PATCH 01/37] attempt to get Ethernet working also, during WiFi installs --- roles/network/templates/network/dhcpcd.conf.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/network/templates/network/dhcpcd.conf.j2 b/roles/network/templates/network/dhcpcd.conf.j2 index 63918be98..8145ccfb8 100644 --- a/roles/network/templates/network/dhcpcd.conf.j2 +++ b/roles/network/templates/network/dhcpcd.conf.j2 @@ -38,7 +38,8 @@ require dhcp_server_identifier slaac private # IIAB -denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} {% if iiab_wired_lan_iface is defined %} {{ iiab_wired_lan_iface }} {% endif %} +denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} +#denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} {% if iiab_wired_lan_iface is defined %} {{ iiab_wired_lan_iface }} {% endif %} #{% if iiab_lan_iface != "br0" %} {{ iiab_lan_iface }} {% endif %} From 7ad820e0a9a0f1f0d79fed4c3fdcb41bd5bddfb8 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 09:40:38 -0500 Subject: [PATCH 02/37] on RPi put "#denyinterfaces wlan0" into /etc/dhcpcd.conf --- roles/network/templates/network/dhcpcd.conf.j2 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/network/templates/network/dhcpcd.conf.j2 b/roles/network/templates/network/dhcpcd.conf.j2 index 8145ccfb8..a7e8508db 100644 --- a/roles/network/templates/network/dhcpcd.conf.j2 +++ b/roles/network/templates/network/dhcpcd.conf.j2 @@ -38,10 +38,13 @@ require dhcp_server_identifier slaac private # IIAB -denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} -#denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} {% if iiab_wired_lan_iface is defined %} {{ iiab_wired_lan_iface }} {% endif %} +{% if is_rpi %} +#denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} +{% else %} +denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} {% if iiab_wired_lan_iface is defined %} {{ iiab_wired_lan_iface }} {% endif %} +{% endif %} -#{% if iiab_lan_iface != "br0" %} {{ iiab_lan_iface }} {% endif %} +{# {% if iiab_lan_iface != "br0" %} {{ iiab_lan_iface }} {% endif %} #} {% if dhcpcd_result == "enabled" and iiab_lan_iface != "none" %} interface {{ iiab_lan_iface }} From 4f250ac5f27956be243614f37037817b1c5431c1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 10:01:46 -0500 Subject: [PATCH 03/37] clarify "RPi - don't reboot to AP post install - installed via wifi" --- roles/network/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 95981e1eb..eac148663 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -27,7 +27,7 @@ - network - AP -- name: RPi reboot to AP post install - installed via wifi - don't blow away current network +- name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network set_fact: no_net_restart: True hostapd_enabled: False From 6a632bffc774f19d4c02433009787b6ccf16079d Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 14:26:56 -0500 Subject: [PATCH 04/37] Typos discovered_*_lan_iface -> iiab_*_lan_iface --- roles/network/tasks/detected_network.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/network/tasks/detected_network.yml b/roles/network/tasks/detected_network.yml index d8d6c0e95..490db8c72 100644 --- a/roles/network/tasks/detected_network.yml +++ b/roles/network/tasks/detected_network.yml @@ -121,19 +121,19 @@ # Select an adapter that is not WAN and not wireless # if there is more than one the last one wins -- name: Set discovered_wired_iface fact if present +- name: Set discovered_wired_iface if present set_fact: discovered_wired_iface: "{{ item|trim }}" when: lan_list_result.stdout_lines is defined and item|trim != discovered_wireless_iface with_items: - "{{ lan_list_result.stdout_lines }}" -- name: Set discovered_wireless_lan_iface fact if present +- name: Set iiab_wireless_lan_iface if present set_fact: iiab_wireless_lan_iface: "{{ discovered_wireless_iface }}" when: discovered_wireless_iface is defined and discovered_wireless_iface != "none" and discovered_wireless_iface != iiab_wan_iface -- name: Set variable discovered_wired_lan_iface if present +- name: Set iiab_wired_lan_iface if present set_fact: iiab_wired_lan_iface: "{{ discovered_wired_iface }}" when: discovered_wired_iface is defined and discovered_wired_iface != "none" and discovered_wired_iface != iiab_wan_iface From 8e17a4bc5364de696a82405e577c73b47235a279 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 16:36:16 -0500 Subject: [PATCH 05/37] 2 line breaks, to correspond w/ output of iiab-hostapd.conf.j2 --- roles/network/templates/hostapd/hostapd.conf.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/network/templates/hostapd/hostapd.conf.j2 b/roles/network/templates/hostapd/hostapd.conf.j2 index 1eb39a8c1..ebce5e047 100644 --- a/roles/network/templates/hostapd/hostapd.conf.j2 +++ b/roles/network/templates/hostapd/hostapd.conf.j2 @@ -2,6 +2,7 @@ interface={% if iiab_wireless_lan_iface is defined %}{{ iiab_wireless_lan_iface }}{% endif %} + ssid={{ host_ssid }} channel={{ host_channel }} {%if iiab_lan_iface == "br0" %} From cbc8ec3f44ccc3fa5d96c1d1bc52c8a58a42f601 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 17:13:22 -0500 Subject: [PATCH 06/37] Clarify output of roles/network/tasks/hostapd.yml --- roles/network/tasks/hostapd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/network/tasks/hostapd.yml b/roles/network/tasks/hostapd.yml index 9a815591a..895ebfce5 100644 --- a/roles/network/tasks/hostapd.yml +++ b/roles/network/tasks/hostapd.yml @@ -1,4 +1,4 @@ -- name: Create a config file for hostapd +- name: Create /etc/hostapd/hostapd.conf from template template: src=hostapd/hostapd.conf.j2 dest=/etc/hostapd/hostapd.conf owner=root @@ -6,7 +6,7 @@ mode=0644 when: iiab_wireless_lan_iface is defined -- name: Create a config template for hostapd +- name: Create /etc/hostapd/hostapd.conf.iiab from template template: src=hostapd/iiab-hostapd.conf.j2 dest=/etc/hostapd/hostapd.conf.iiab owner=root @@ -27,14 +27,14 @@ mode=0644 when: hostapd_enabled -- name: Use custom iiab-hotspot-on +- name: Create /usr/bin/iiab-hotspot-on from template template: src=network/iiab-hotspot-on dest=/usr/bin/iiab-hotspot-on owner=root group=root mode=0755 -- name: Use custom iiab-hotspot-off +- name: Create /usr/bin/iiab-hotspot-off from template template: src=network/iiab-hotspot-off dest=/usr/bin/iiab-hotspot-off owner=root From c412f02f704118316716e3876f6e237f4b9dc460 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 18:57:22 -0500 Subject: [PATCH 07/37] Enable manually_toggle_AP when WiFi is primary gateway --- roles/network/tasks/main.yml | 82 ++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index eac148663..8f9dd40f0 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -1,23 +1,27 @@ - #- include_vars: roles/network/defaults/main.yml #- include_vars: vars/local_vars.yml - include_tasks: detected_network.yml - when: not installing + when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml tags: - - network + - network #REMOVE SUCH LINES (BELOW TOO) AS WE'RE IN "network" ? - network-discover +- name: Enable manually_toggle_AP if WiFi is primary gateway + set_fact: + manually_toggle_AP: true + when: discovered_wireless_iface == iiab_wan_iface + - name: RPi - reboot to AP post install - installed via wifi so the services are ready set_fact: - iiab_lan_iface: br0 - iiab_wan_iface: "{{ discovered_wired_iface }}" - iiab_wireless_lan_iface: "{{ discovered_wireless_iface }}" - iiab_wired_lan_iface: "" + iiab_lan_iface: br0 + iiab_wan_iface: "{{ discovered_wired_iface }}" + iiab_wireless_lan_iface: "{{ discovered_wireless_iface }}" + iiab_wired_lan_iface: "" when: is_rpi and discovered_wireless_iface is defined and discovered_wireless_iface == iiab_wan_iface and reboot_to_AP - include_tasks: computed_network.yml - when: not installing + when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml tags: - network - network-discover @@ -29,8 +33,8 @@ - name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network set_fact: - no_net_restart: True - hostapd_enabled: False + no_net_restart: True + hostapd_enabled: False when: is_rpi and discovered_wireless_iface is defined and discovered_wired_iface != iiab_wan_iface ##### Start static ip address info for first run ##### @@ -47,7 +51,9 @@ - name: Configuring wondershaper include_tasks: wondershaper.yml when: wondershaper_install - tags: wondershaper, network + tags: + - network + - wondershaper - name: (Re)Installing named include_tasks: named.yml @@ -86,64 +92,66 @@ #### Start network layout - name: Redhat networking include_tasks: ifcfg_mods.yml - tags: - - network when: is_redhat and not installing + tags: + - network - name: NetworkManager in use include_tasks: NM-debian.yml - tags: - - network when: is_debuntu and network_manager_active #and not installing + tags: + - network - name: systemd-networkd in use include_tasks: sysd-netd-debian.yml - tags: - - network when: is_debuntu and systemd_networkd_active #and not installing + tags: + - network - name: RPi's have dhcpcd in use include_tasks: rpi_debian.yml - tags: - - network when: is_debuntu and is_rpi #and not installing + tags: + - network - name: Not RPi, Not NetworkManager, Not systemd-networkd in use include_tasks: debian.yml - tags: - - network when: not is_rpi and not network_manager_active and not systemd_networkd_active and is_debuntu #and not installing + tags: + - network # this is moving - name: Record iiab_wan_device - lineinfile: dest=/etc/iiab/iiab.env - regexp='^IIAB_WAN_DEVICE=*' - line='IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"' - state=present + lineinfile: + dest: /etc/iiab/iiab.env + regexp: '^IIAB_WAN_DEVICE=*' + line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"' + state: present when: not installing tags: - - network + - network - name: Record iiab_lan_device - lineinfile: dest=/etc/iiab/iiab.env - regexp='^IIAB_LAN_DEVICE=*' - line='IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"' - state=present + lineinfile: + dest: /etc/iiab/iiab.env + regexp: '^IIAB_LAN_DEVICE=*' + line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"' + state: present when: not installing tags: - - network + - network #### end network layout - include_tasks: restart.yml when: not installing tags: - - network - - named - - dhcpd - - dnsmasq - - squid - - AP + - network + - named + - dhcpd + - dnsmasq + - squid + - AP From 3a1d9e2657a12eb07a2705dac42ec45286006d4f Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 19:02:06 -0500 Subject: [PATCH 08/37] "manually_toggle_AP: false" unless WiFi install detected --- roles/network/defaults/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 8c2c66c58..8e2d37a4f 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -48,6 +48,8 @@ host_country_code: US hostapd_secure: True hostapd_password: "iiab2017" driver_name: nl80211 +# Defer AP if WiFi install detected ("iiab-hotspot-on" should be run manually) +manually_toggle_AP: false network_config_dir: /etc/network/interfaces.d #iiab_network_mode: "Gateway" From 2ba4737abaf8eb2391e89fcf528fc06e89a29c5e Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 19:08:13 -0500 Subject: [PATCH 09/37] hostapd.yml: enable/restart svc if manually_toggle_AP is false --- roles/network/tasks/hostapd.yml | 68 ++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/roles/network/tasks/hostapd.yml b/roles/network/tasks/hostapd.yml index 895ebfce5..7f1773bf2 100644 --- a/roles/network/tasks/hostapd.yml +++ b/roles/network/tasks/hostapd.yml @@ -1,47 +1,55 @@ - name: Create /etc/hostapd/hostapd.conf from template - template: src=hostapd/hostapd.conf.j2 - dest=/etc/hostapd/hostapd.conf - owner=root - group=root - mode=0644 + template: + src: hostapd/hostapd.conf.j2 + dest: /etc/hostapd/hostapd.conf + owner: root + group: root + mode: 0644 when: iiab_wireless_lan_iface is defined - name: Create /etc/hostapd/hostapd.conf.iiab from template - template: src=hostapd/iiab-hostapd.conf.j2 - dest=/etc/hostapd/hostapd.conf.iiab - owner=root - group=root - mode=0644 + template: + src: hostapd/iiab-hostapd.conf.j2 + dest: /etc/hostapd/hostapd.conf.iiab + owner: root + group: root + mode: 0644 when: discovered_wireless_iface is defined - name: Disable the Access Point 'hostapd' service - service: enabled=no - name=hostapd.service + service: + enabled: no + name: hostapd.service when: not hostapd_enabled - name: Use custom systemd unit file to start 'hostapd' service - template: src=hostapd/hostapd.service.j2 - dest=/etc/systemd/system/hostapd.service - owner=root - group=root - mode=0644 + template: + src: hostapd/hostapd.service.j2 + dest: /etc/systemd/system/hostapd.service + owner: root + group: root + mode: 0644 when: hostapd_enabled - name: Create /usr/bin/iiab-hotspot-on from template - template: src=network/iiab-hotspot-on - dest=/usr/bin/iiab-hotspot-on - owner=root - group=root - mode=0755 + template: + src: network/iiab-hotspot-on + dest: /usr/bin/iiab-hotspot-on + owner: root + group: root + mode: 0755 - name: Create /usr/bin/iiab-hotspot-off from template - template: src=network/iiab-hotspot-off - dest=/usr/bin/iiab-hotspot-off - owner=root - group=root - mode=0755 + template: + src: network/iiab-hotspot-off + dest: /usr/bin/iiab-hotspot-off + owner: root + group: root + mode: 0755 - name: Enable the Access Point 'hostapd' service - service: enabled=yes - name=hostapd.service - when: iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance" and hostapd_enabled + service: + # enabled: yes + state: restarted + name: hostapd.service + when: hostapd_enabled and not manually_toggle_AP and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance" From 5261301482466c969f86a5f2a690d292ebd2b993 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 19:12:36 -0500 Subject: [PATCH 10/37] Clarify hostapd service is being restarted --- roles/network/tasks/hostapd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/hostapd.yml b/roles/network/tasks/hostapd.yml index 7f1773bf2..cfddbc45b 100644 --- a/roles/network/tasks/hostapd.yml +++ b/roles/network/tasks/hostapd.yml @@ -47,7 +47,7 @@ group: root mode: 0755 -- name: Enable the Access Point 'hostapd' service +- name: Enable/Restart the Access Point 'hostapd' service service: # enabled: yes state: restarted From 2d6d510e63e8d93c6c476cc2d4bf401269fca6fc Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 19:28:20 -0500 Subject: [PATCH 11/37] always support Ethernet-to-Internet on RPi: use discovered_wireless_iface (not iiab_wireless_lan_iface) to toggle AP --- roles/network/templates/network/dhcpcd.conf.j2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/network/templates/network/dhcpcd.conf.j2 b/roles/network/templates/network/dhcpcd.conf.j2 index a7e8508db..2c74f18e5 100644 --- a/roles/network/templates/network/dhcpcd.conf.j2 +++ b/roles/network/templates/network/dhcpcd.conf.j2 @@ -37,9 +37,11 @@ require dhcp_server_identifier # Generate Stable Private IPv6 Addresses instead of hardware based ones slaac private -# IIAB -{% if is_rpi %} -#denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} +# IIAB - always support Ethernet-to-Internet on RPi +{% if is_rpi and manually_toggle_AP %} +#denyinterfaces {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} +{% elif is_rpi %} +denyinterfaces {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} {% else %} denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} {% if iiab_wired_lan_iface is defined %} {{ iiab_wired_lan_iface }} {% endif %} {% endif %} From a2ab1b79cc89f836f959be3aa35a6fdd15eadd8c Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 19:39:29 -0500 Subject: [PATCH 12/37] Clarif: manually_toggle_AP used in hostapd.yml & rpi_debian.yml --- roles/network/tasks/main.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 8f9dd40f0..7b7debe02 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -7,18 +7,19 @@ - network #REMOVE SUCH LINES (BELOW TOO) AS WE'RE IN "network" ? - network-discover +# manually_toggle_AP is used in hostapd.yml and in rpi_debian.yml's dhcpcd.conf.j2 (both below) - name: Enable manually_toggle_AP if WiFi is primary gateway set_fact: manually_toggle_AP: true - when: discovered_wireless_iface == iiab_wan_iface + when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP -- name: RPi - reboot to AP post install - installed via wifi so the services are ready - set_fact: - iiab_lan_iface: br0 - iiab_wan_iface: "{{ discovered_wired_iface }}" - iiab_wireless_lan_iface: "{{ discovered_wireless_iface }}" - iiab_wired_lan_iface: "" - when: is_rpi and discovered_wireless_iface is defined and discovered_wireless_iface == iiab_wan_iface and reboot_to_AP +#- name: RPi - reboot to AP post install - installed via wifi so the services are ready +# set_fact: +# iiab_lan_iface: br0 +# iiab_wan_iface: "{{ discovered_wired_iface }}" +# iiab_wireless_lan_iface: "{{ discovered_wireless_iface }}" +# iiab_wired_lan_iface: "" +# when: is_rpi and discovered_wireless_iface is defined and discovered_wireless_iface == iiab_wan_iface and reboot_to_AP - include_tasks: computed_network.yml when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml @@ -31,11 +32,11 @@ - network - AP -- name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network - set_fact: - no_net_restart: True - hostapd_enabled: False - when: is_rpi and discovered_wireless_iface is defined and discovered_wired_iface != iiab_wan_iface +#- name: RPi - don't reboot to AP post install - installed via wifi - don't blow away current network +# set_fact: +# no_net_restart: True +# hostapd_enabled: False +# when: is_rpi and discovered_wireless_iface is defined and discovered_wired_iface != iiab_wan_iface ##### Start static ip address info for first run ##### #- include_tasks: static.yml From 82862c4dd028a23c62d876c3c7987f8890794805 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 22:01:01 -0500 Subject: [PATCH 13/37] "when: not installing" redundant...comment or remove!? --- roles/network/tasks/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 7b7debe02..21f441879 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -93,7 +93,8 @@ #### Start network layout - name: Redhat networking include_tasks: ifcfg_mods.yml - when: is_redhat and not installing + when: is_redhat +#and not installing tags: - network @@ -132,7 +133,7 @@ regexp: '^IIAB_WAN_DEVICE=*' line: 'IIAB_WAN_DEVICE="{{ iiab_wan_iface }}"' state: present - when: not installing + when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml tags: - network @@ -142,7 +143,7 @@ regexp: '^IIAB_LAN_DEVICE=*' line: 'IIAB_LAN_DEVICE="{{ iiab_lan_iface }}"' state: present - when: not installing + when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml tags: - network From 7986d5b28a047c5ff16b72432d9c82b2071bb2dc Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 22:11:37 -0500 Subject: [PATCH 14/37] Clarify IIAB_LAN|WAN_DEVICE saved to /etc/iiab/iiab.env --- roles/network/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 21f441879..5dd6c924e 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -127,7 +127,7 @@ - network # this is moving -- name: Record iiab_wan_device +- name: Record IIAB_WAN_DEVICE to /etc/iiab/iiab.env lineinfile: dest: /etc/iiab/iiab.env regexp: '^IIAB_WAN_DEVICE=*' @@ -137,7 +137,7 @@ tags: - network -- name: Record iiab_lan_device +- name: Record IIAB_LAN_DEVICE to /etc/iiab/iiab.env lineinfile: dest: /etc/iiab/iiab.env regexp: '^IIAB_LAN_DEVICE=*' From 764f301cb2e5797c41967d9795980b574390f4ba Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 22:33:24 -0500 Subject: [PATCH 15/37] Update hostapd.conf.j2 --- roles/network/templates/hostapd/hostapd.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/templates/hostapd/hostapd.conf.j2 b/roles/network/templates/hostapd/hostapd.conf.j2 index ebce5e047..9e38ace62 100644 --- a/roles/network/templates/hostapd/hostapd.conf.j2 +++ b/roles/network/templates/hostapd/hostapd.conf.j2 @@ -5,7 +5,7 @@ interface={% if iiab_wireless_lan_iface is defined %}{{ iiab_wireless_lan_iface ssid={{ host_ssid }} channel={{ host_channel }} -{%if iiab_lan_iface == "br0" %} +{%if iiab_lan_iface == "br0" %} bridge=br0 {% endif %} From 1f98d7947aa2e1fa6e5afa0fea58eabacea8ded7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 28 Dec 2017 22:34:28 -0500 Subject: [PATCH 16/37] Update iiab-hostapd.conf.j2 --- roles/network/templates/hostapd/iiab-hostapd.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/templates/hostapd/iiab-hostapd.conf.j2 b/roles/network/templates/hostapd/iiab-hostapd.conf.j2 index 5ee541281..3cfffc69e 100644 --- a/roles/network/templates/hostapd/iiab-hostapd.conf.j2 +++ b/roles/network/templates/hostapd/iiab-hostapd.conf.j2 @@ -4,7 +4,7 @@ interface={{ discovered_wireless_iface }} ssid={{ host_ssid }} channel={{ host_channel }} -{%if iiab_lan_iface == "br0" %} +{%if iiab_lan_iface == "br0" %} bridge=br0 {% endif %} From 44675f659a7dfbe8e9ceed26539d18419a0f59d5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Dec 2017 01:03:02 -0500 Subject: [PATCH 17/37] "no_net_restart: True" to prevent WiFi flakiness? --- roles/network/tasks/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 5dd6c924e..59ebc01ab 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -6,11 +6,13 @@ tags: - network #REMOVE SUCH LINES (BELOW TOO) AS WE'RE IN "network" ? - network-discover - -# manually_toggle_AP is used in hostapd.yml and in rpi_debian.yml's dhcpcd.conf.j2 (both below) + - name: Enable manually_toggle_AP if WiFi is primary gateway set_fact: - manually_toggle_AP: true + manually_toggle_AP: true # used in (1) hostapd.yml, (2) rpi_debian.yml + + # (3) its dhcpcd.conf.j2, (4) restart.yml + no_net_restart: True # used below in (1) sysd-netd-debian.yml, + # (2) debian.yml, (3) rpi_debian.yml when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP #- name: RPi - reboot to AP post install - installed via wifi so the services are ready From 4dc6643d4787f901cd2c286c36c91d64f8f98905 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Dec 2017 01:08:01 -0500 Subject: [PATCH 18/37] Avoid restarting hostapd unless nec --- roles/network/tasks/rpi_debian.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/network/tasks/rpi_debian.yml b/roles/network/tasks/rpi_debian.yml index d44ce6ea5..9bd335c65 100644 --- a/roles/network/tasks/rpi_debian.yml +++ b/roles/network/tasks/rpi_debian.yml @@ -38,19 +38,19 @@ name: dhcpcd state: restarted -- name: Restart the networking service +- name: Restart the networking service if appropriate service: name: networking enabled: yes state: restarted when: not nobridge is defined and not no_net_restart -- name: Restart hostapd when WiFi is present +- name: Restart hostapd if appropriate service: name: hostapd enabled: yes state: restarted - when: iiab_wireless_lan_iface is defined and hostapd_enabled and iiab_network_mode != "Appliance" + when: hostapd_enabled and not manually_toggle_AP and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance" #- name: dhcp_server may be affected - starting - user choice # service: name={{ dhcp_service2 }} state=started From 3d5d5ac039aaa946884cf692344ea0d0ec35ba25 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Dec 2017 01:19:06 -0500 Subject: [PATCH 19/37] Avoid restarting hostapd if manually_toggle_AP --- roles/network/tasks/restart.yml | 50 ++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/roles/network/tasks/restart.yml b/roles/network/tasks/restart.yml index a8c22c727..dd1855d22 100644 --- a/roles/network/tasks/restart.yml +++ b/roles/network/tasks/restart.yml @@ -3,44 +3,52 @@ # when: iiab_wireless_lan_iface is defined and hostapd_enabled - name: Start named service - service: name={{ dns_service }} - state=restarted + service: + name: "{{ dns_service }}" + state: restarted when: named_enabled and named_install - name: Stop Squid service - service: name={{ proxy }} - state=stopped + service: + name: "{{ proxy }}" + state: stopped async: 120 when: squid_install - name: Stop DansGuardian - service: name=dansguardian - state=stopped + service: + name: dansguardian + state: stopped when: dansguardian_install - name: Restart DansGuardian - except Ubuntu which needs reboot to activate - service: name=dansguardian - state=restarted + service: + name: dansguardian + 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 - service: name={{ proxy }} - state=restarted + service: + name: "{{ proxy }}" + state: restarted when: squid_enabled and squid_install - name: Restart Wondershaper service - service: name=wondershaper - state=restarted + service: + name: wondershaper + state: restarted when: wondershaper_enabled - name: Restart avahi service - service: name=avahi-daemon - state=restarted + service: + name: avahi-daemon + state: restarted - name: Create gateway flag shell: echo 1 > /etc/sysconfig/olpc-scripts/setup.d/installed/gateway - creates=/etc/sysconfig/olpc-scripts/setup.d/installed/gateway + args: + creates: /etc/sysconfig/olpc-scripts/setup.d/installed/gateway when: iiab_network_mode == "Gateway" - name: Waiting {{ hostapd_wait }} seconds for network to stabilize @@ -55,11 +63,13 @@ register: wifi_slave - name: Restart hostapd if WiFi slave is inactive - service: name=hostapd.service - state=restarted - when: wifi_slave.stdout is defined and hostapd_enabled and wifi_slave.stdout == 0 + service: + name: hostapd.service + state: restarted + when: hostapd_enabled and not manually_toggle_AP and wifi_slave.stdout is defined and wifi_slave.stdout == 0 - name: dhcp_server may be affected - starting - user choice - service: name={{ dhcp_service2 }} - state=restarted + service: + name: "{{ dhcp_service2 }}" + state: restarted when: iiab_network_mode != "Appliance" From 63ebba5c14a06e96bea1cfe755ea329305f1c43a Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Dec 2017 01:29:17 -0500 Subject: [PATCH 20/37] Update main.yml --- roles/network/defaults/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 8e2d37a4f..773b8f80e 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -48,8 +48,9 @@ host_country_code: US hostapd_secure: True hostapd_password: "iiab2017" driver_name: nl80211 -# Defer AP if WiFi install detected ("iiab-hotspot-on" should be run manually) manually_toggle_AP: false +# Above defers AP if installing via WiFi (then after ./iiab-install completes +# and content is downloaded, run "iiab-hotspot-on" to enable internal AP). network_config_dir: /etc/network/interfaces.d #iiab_network_mode: "Gateway" From beb29901804a0a9d9c17430971cec1ff93e6c7c5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Dec 2017 02:24:04 -0500 Subject: [PATCH 21/37] Update tz.yml --- roles/0-init/tasks/tz.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roles/0-init/tasks/tz.yml b/roles/0-init/tasks/tz.yml index d2e0f4991..5263c23d0 100644 --- a/roles/0-init/tasks/tz.yml +++ b/roles/0-init/tasks/tz.yml @@ -5,28 +5,28 @@ - name: Set local and iiab TZ to UTC if /etc/localtime is not set set_fact: - local_tz: 'UTC' - iiab_TZ: 'UTC' + local_tz: 'UTC' + iiab_TZ: 'UTC' when: TZ_set.stdout == "" - name: Override ansible on timezone if TZ set set_fact: - local_tz: '{{ TZ_set.stdout }}' + local_tz: '{{ TZ_set.stdout }}' when: TZ_set.stdout != "" - name: Using iiab TZ for local TZ set_fact: - local_tz: '{{ iiab_TZ }}' + local_tz: '{{ iiab_TZ }}' when: iiab_TZ is defined and iiab_TZ != "" and iiab_TZ != "TZ_set.stdout" -- name: Set default Timezone from iiab TZ - Debian +- name: Set default Timezone from iiab TZ (debuntu) shell: timedatectl set-timezone {{ iiab_TZ }} when: is_debuntu and iiab_TZ is defined and iiab_TZ != "" and iiab_TZ != "TZ_set.stdout" -- name: Set default Timezone from iiab TZ - Redhat +- name: Set default Timezone from iiab TZ (redhat) file: - path: /etc/localtime - src: /usr/share/zoneinfo/{{ iiab_TZ }} - force: yes - state: link + path: /etc/localtime + src: "/usr/share/zoneinfo/{{ iiab_TZ }}" + force: yes + state: link when: is_redhat and iiab_TZ is defined and iiab_TZ != "" and iiab_TZ != "TZ_set.stdout" From fe93538229de72ce92198683da21073f9a3f71f1 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Dec 2017 02:25:06 -0500 Subject: [PATCH 22/37] Update iiab-network --- iiab-network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iiab-network b/iiab-network index 3b3b634f1..65c77b55a 100755 --- a/iiab-network +++ b/iiab-network @@ -30,7 +30,7 @@ End=`date` # Record critical diagnostics to [/opt/iiab/iiab/]iiab-network.log -echo "" >> iiab-network.log +echo >> iiab-network.log # redhat path # Paul Armstrong's Shell Style Guide (https://google.github.io/styleguide/shell.xml) From 8ee3c0a37533cea153cdb849a6d565963e69501b Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 10:48:24 -0500 Subject: [PATCH 23/37] manually_toggle_AP: false -> hostapd_enabled: True --- roles/network/defaults/main.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 773b8f80e..724d4f887 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -48,9 +48,13 @@ host_country_code: US hostapd_secure: True hostapd_password: "iiab2017" driver_name: nl80211 -manually_toggle_AP: false -# Above defers AP if installing via WiFi (then after ./iiab-install completes -# and content is downloaded, run "iiab-hotspot-on" to enable internal AP). +hostapd_enabled: True +# Above is forcibly set to False (in roles/network/tasks/main.yml) if IIAB is +# being WiFi-installed (run "iiab-hotspot-on" AFTER ./iiab-install completes +# and content is downloaded, to enable the internal WiFi Access Point / AP!) +reboot_to_AP: False +# For those installing IIAB over WiFi: "reboot_to_AP: True" overrides the above +# behavior, forcing "hostapd_enabled: True" even if installing over WiFi. network_config_dir: /etc/network/interfaces.d #iiab_network_mode: "Gateway" From b8d996d7b32e14e75e1abb3a1890460518627a09 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 10:48:43 -0500 Subject: [PATCH 24/37] manually_toggle_AP: false -> hostapd_enabled: True --- vars/default_vars.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 1cba88745..e382c5c9b 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -65,16 +65,22 @@ lan_netmask: 255.255.224.0 # Internal Wi-Fi Access Point # Values are used if there is an internal Wi-Fi adapter and hostapd is enabled # The platform variable adapts install to specific hardware (raspberry pi=rpi2) -hostapd_enabled: True host_ssid: "Internet in a Box" host_wifi_mode: g host_channel: 6 hostapd_secure: False hostapd_password: changeme -# For those installing IIAB over WiFi: "reboot_to_AP: True" makes the internal -# WiFi Access active after the next reboot. This is equivalent to manually -# running "iiab-hotspot-on". Note this variable only works with RPi's for now. +hostapd_enabled: True +# Above is forcibly set to False (in roles/network/tasks/main.yml) if IIAB is +# being WiFi-installed (run "iiab-hotspot-on" AFTER ./iiab-install completes +# and content is downloaded, to enable the internal WiFi Access Point / AP!) reboot_to_AP: False +# For those installing IIAB over WiFi: "reboot_to_AP: True" overrides the above +# behavior, forcing "hostapd_enabled: True" even if installing over WiFi. +## Note this variable only works with RPi's for now. +## makes the internal +## WiFi Access active after the next reboot. This is equivalent to manually +## running "iiab-hotspot-on". Note this variable only works with RPi's for now. # Gateway mode iiab_lan_enabled: True From 25161b558de79ced1a8c09c429ac4ffa0b92cc04 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 10:50:47 -0500 Subject: [PATCH 25/37] manually_toggle_AP: false -> hostapd_enabled: True --- roles/network/tasks/hostapd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/hostapd.yml b/roles/network/tasks/hostapd.yml index cfddbc45b..e5d744d5e 100644 --- a/roles/network/tasks/hostapd.yml +++ b/roles/network/tasks/hostapd.yml @@ -52,4 +52,4 @@ # enabled: yes state: restarted name: hostapd.service - when: hostapd_enabled and not manually_toggle_AP and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance" + when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance" From 4272185a88a4b9b5592fc0702f316273e34d15a7 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 10:58:46 -0500 Subject: [PATCH 26/37] manually_toggle_AP: True -> hostapd_enabled: False --- roles/network/tasks/main.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 59ebc01ab..2f59960c3 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -1,15 +1,12 @@ -#- include_vars: roles/network/defaults/main.yml -#- include_vars: vars/local_vars.yml - - include_tasks: detected_network.yml when: not installing #REMOVE THIS LINE IF installing IS ALWAYS false AS SET IN roles/0-init/defaults/main.yml tags: - network #REMOVE SUCH LINES (BELOW TOO) AS WE'RE IN "network" ? - network-discover -- name: Enable manually_toggle_AP if WiFi is primary gateway +- name: IF WIFI IS PRIMARY GATEWAY, PLEASE RUN 'iiab-hotspot-on' MANUALLY set_fact: - manually_toggle_AP: true # used in (1) hostapd.yml, (2) rpi_debian.yml + + hostapd_enabled: False # used in (1) hostapd.yml, (2) rpi_debian.yml + # (3) its dhcpcd.conf.j2, (4) restart.yml no_net_restart: True # used below in (1) sysd-netd-debian.yml, # (2) debian.yml, (3) rpi_debian.yml From f6e3d6830bcde2b05134412fb1cef00421a828ce Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 11:03:29 -0500 Subject: [PATCH 27/37] manually_toggle_AP: True -> hostapd_enabled: False --- roles/network/tasks/restart.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network/tasks/restart.yml b/roles/network/tasks/restart.yml index dd1855d22..98fc09114 100644 --- a/roles/network/tasks/restart.yml +++ b/roles/network/tasks/restart.yml @@ -59,14 +59,14 @@ - name: Checking if WiFi slave is active shell: brctl show br0 | grep {{ iiab_wireless_lan_iface }} | wc -l - when: iiab_wireless_lan_iface is defined and iiab_lan_iface == "br0" and hostapd_enabled + when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_lan_iface == "br0" register: wifi_slave - name: Restart hostapd if WiFi slave is inactive service: name: hostapd.service state: restarted - when: hostapd_enabled and not manually_toggle_AP and wifi_slave.stdout is defined and wifi_slave.stdout == 0 + when: hostapd_enabled and wifi_slave.stdout is defined and wifi_slave.stdout == 0 - name: dhcp_server may be affected - starting - user choice service: From ebd2f3ac61d6bcb84ba7dbadc8385ef0c13fdc21 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 11:04:30 -0500 Subject: [PATCH 28/37] manually_toggle_AP: True -> hostapd_enabled: False --- roles/network/tasks/rpi_debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/tasks/rpi_debian.yml b/roles/network/tasks/rpi_debian.yml index 9bd335c65..25390091b 100644 --- a/roles/network/tasks/rpi_debian.yml +++ b/roles/network/tasks/rpi_debian.yml @@ -50,7 +50,7 @@ name: hostapd enabled: yes state: restarted - when: hostapd_enabled and not manually_toggle_AP and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance" + when: hostapd_enabled and iiab_wireless_lan_iface is defined and iiab_network_mode != "Appliance" #- name: dhcp_server may be affected - starting - user choice # service: name={{ dhcp_service2 }} state=started From 61e722a7880778aedc951e3972a3aeff1628a246 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 11:11:37 -0500 Subject: [PATCH 29/37] manually_toggle_AP: False -> hostapd_enabled: True --- roles/network/templates/network/dhcpcd.conf.j2 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/network/templates/network/dhcpcd.conf.j2 b/roles/network/templates/network/dhcpcd.conf.j2 index 2c74f18e5..181d16aaf 100644 --- a/roles/network/templates/network/dhcpcd.conf.j2 +++ b/roles/network/templates/network/dhcpcd.conf.j2 @@ -37,11 +37,13 @@ require dhcp_server_identifier # Generate Stable Private IPv6 Addresses instead of hardware based ones slaac private -# IIAB - always support Ethernet-to-Internet on RPi -{% if is_rpi and manually_toggle_AP %} -#denyinterfaces {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} -{% elif is_rpi %} +# IIAB + +# always support Ethernet-to-Internet on RPi (avoid "denyinterfaces eth0") +{% if is_rpi and hostapd_enabled %} denyinterfaces {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} +{% elif is_rpi %} +#denyinterfaces {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} {% else %} denyinterfaces {% if iiab_wireless_lan_iface is defined %} {{ iiab_wireless_lan_iface }} {% endif %} {% if iiab_wired_lan_iface is defined %} {{ iiab_wired_lan_iface }} {% endif %} {% endif %} From bf3dca7000979976316fab1c6abdee57aeb2d3e8 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 11:21:12 -0500 Subject: [PATCH 30/37] Update default_vars.yml --- vars/default_vars.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index e382c5c9b..92ad123b2 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -77,10 +77,6 @@ hostapd_enabled: True reboot_to_AP: False # For those installing IIAB over WiFi: "reboot_to_AP: True" overrides the above # behavior, forcing "hostapd_enabled: True" even if installing over WiFi. -## Note this variable only works with RPi's for now. -## makes the internal -## WiFi Access active after the next reboot. This is equivalent to manually -## running "iiab-hotspot-on". Note this variable only works with RPi's for now. # Gateway mode iiab_lan_enabled: True From e010c060d85ca8c9e8f67b009fc35473461dda89 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 11:30:02 -0500 Subject: [PATCH 31/37] Explain hostapd_enabled: & reboot_to_AP: --- roles/network/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 724d4f887..cc6862dee 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -54,7 +54,7 @@ hostapd_enabled: True # and content is downloaded, to enable the internal WiFi Access Point / AP!) reboot_to_AP: False # For those installing IIAB over WiFi: "reboot_to_AP: True" overrides the above -# behavior, forcing "hostapd_enabled: True" even if installing over WiFi. +# detection of WiFi-as-gateway, forcing "hostapd_enabled: True" regardless. network_config_dir: /etc/network/interfaces.d #iiab_network_mode: "Gateway" From 9d94af43b3c903b77fb5237be414841093178f68 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 11:30:14 -0500 Subject: [PATCH 32/37] Explain hostapd_enabled: & reboot_to_AP: --- vars/default_vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/default_vars.yml b/vars/default_vars.yml index 92ad123b2..c0e4c32f6 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -76,7 +76,7 @@ hostapd_enabled: True # and content is downloaded, to enable the internal WiFi Access Point / AP!) reboot_to_AP: False # For those installing IIAB over WiFi: "reboot_to_AP: True" overrides the above -# behavior, forcing "hostapd_enabled: True" even if installing over WiFi. +# detection of WiFi-as-gateway, forcing "hostapd_enabled: True" regardless. # Gateway mode iiab_lan_enabled: True From 95f726e913a416b0b922d8c9e5c0278aa94cb318 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 1 Jan 2018 11:45:19 -0500 Subject: [PATCH 33/37] Context Explained: WiFi-as-gateway detection logic --- roles/network/tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index 2f59960c3..98dc85c29 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -3,7 +3,7 @@ tags: - network #REMOVE SUCH LINES (BELOW TOO) AS WE'RE IN "network" ? - network-discover - + - name: IF WIFI IS PRIMARY GATEWAY, PLEASE RUN 'iiab-hotspot-on' MANUALLY set_fact: hostapd_enabled: False # used in (1) hostapd.yml, (2) rpi_debian.yml + @@ -11,6 +11,9 @@ no_net_restart: True # used below in (1) sysd-netd-debian.yml, # (2) debian.yml, (3) rpi_debian.yml when: discovered_wireless_iface == iiab_wan_iface and not reboot_to_AP +# Idea, Not Without Risks: should WiFi-as-gateway detection logic +# be encapsulated into roles/network/tasks/hostapd.yml in future? +# Today "./runtags hostapd" doesn't exist & "./runtags AP" is at yr own risk. #- name: RPi - reboot to AP post install - installed via wifi so the services are ready # set_fact: From b9f6dc5a7b188e969e8ef38fab39e37b433dcd42 Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 4 Jan 2018 23:28:43 -0500 Subject: [PATCH 34/37] wlan0 promiscuous pn iiab-hotspot-off...only if rpi --- roles/network/templates/network/iiab-hotspot-off | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/network/templates/network/iiab-hotspot-off b/roles/network/templates/network/iiab-hotspot-off index d14cc6038..9e0027d6f 100755 --- a/roles/network/templates/network/iiab-hotspot-off +++ b/roles/network/templates/network/iiab-hotspot-off @@ -7,3 +7,7 @@ systemctl stop dhcpd systemctl daemon-reload systemctl restart dhcpcd systemctl restart networking + +# Experimental/Temporary workaround for WiFi "10SEC disease" +# https://github.com/iiab/iiab/issues/638#issuecomment-355455454 +if grep -qi raspbian /etc/*release; then ip link set dev wlan0 promisc on; fi From e157c5e5c686a1acd512922ccd65617d3208e03f Mon Sep 17 00:00:00 2001 From: A Holt Date: Thu, 4 Jan 2018 23:53:39 -0500 Subject: [PATCH 35/37] RPi: wlan0 promiscuous starts in Stage 2 (iiab-startup.sh) --- roles/2-common/templates/iiab-startup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/2-common/templates/iiab-startup.sh b/roles/2-common/templates/iiab-startup.sh index afb2c1d98..012a32746 100644 --- a/roles/2-common/templates/iiab-startup.sh +++ b/roles/2-common/templates/iiab-startup.sh @@ -4,5 +4,9 @@ if [ ! -f /etc/iiab/uuid ]; then uuidgen > /etc/iiab/uuid fi -exit 0 +# Experimental/Temporary workaround for WiFi "10SEC disease" +# https://github.com/iiab/iiab/issues/638#issuecomment-355455454 +if grep -qi raspbian /etc/*release; then ip link set dev wlan0 promisc on; fi + +exit 0 From b61ff861acb52715d572371f1e6c27875df38405 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 9 Jan 2018 14:56:54 -0500 Subject: [PATCH 36/37] flag calibre_debs_on_debian clarified in comments --- roles/calibre/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 556ead031..097e7b044 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -1,12 +1,12 @@ # 1. INSTALL THE LATEST CALIBRE 3.X+ (calibre-server etc) ON ALL OS'S # RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST -- name: Install Calibre via calibre-installer.py (OS's other than Raspbian) +- name: Install Calibre via calibre-installer.py (redhat, ubuntu, debian if NOT calibre_debs_on_debian) include_tasks: py-installer.yml when: is_redhat or is_ubuntu or (is_debian and not calibre_debs_on_debian) #when: not is_rpi -- name: Install Calibre via .debs (Raspbian) +- name: Install Calibre via .debs (Raspbian, Debian if calibre_debs_on_debian) include_tasks: debs.yml when: is_rpi or (is_debian and calibre_debs_on_debian) #when: is_rpi or is_debian # (is_debian also covers & includes is_rpi) From 3ccccbd9bcd20266d0e287c6930d3f9184c949cf Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 10 Jan 2018 17:09:09 -0500 Subject: [PATCH 37/37] Clarify how calibre-install-latest.sh works in comments? --- scripts/calibre-install-latest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/calibre-install-latest.sh b/scripts/calibre-install-latest.sh index 69f2e4d43..77730fa4b 100755 --- a/scripts/calibre-install-latest.sh +++ b/scripts/calibre-install-latest.sh @@ -7,7 +7,7 @@ export DEBIAN_FRONTEND=noninteractive # Drags in stock desktop dependencies without too much from testing below apt -y install calibre-bin dirmngr -# Updates calibre-bin to version 3.10 from testing +# Updates calibre-bin to version 3.10 or 3.14 or ... from testing (SEE http://archive.raspbian.org/raspbian/pool/main/c/calibre/ ?) apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010 echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list.d/debian-testing.list apt update @@ -15,7 +15,7 @@ apt -y install libqt5core5a python-lxml calibre # Remove last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list sed -i '$ d' /etc/apt/sources.list.d/debian-testing.list -# Updates to calibre & calibre-bin to 3.12 from unstable +# Updates to calibre & calibre-bin to "very latest" 3.x from unstable echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list.d/debian-unstable.list apt update apt -y install calibre