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

Merge branch 'wifi-hw' of https://github.com/jvonau/iiab into wifi-hw

This commit is contained in:
root 2022-03-15 16:05:57 -04:00
commit 4f7970078b
3 changed files with 30 additions and 12 deletions

View file

@ -23,6 +23,22 @@
## DISCOVER PLATFORMS ######
# Put conditional actions for hardware platforms here
- name: Look for any wireless devices present
shell: "ls -la /sys/class/net/*/phy80211 | awk -F / '{print $5}'"
register: has_wifi_device
ignore_errors: True
changed_when: False
- name: Set has_wireless, if found
set_fact:
has_wireless: True
when: has_wifi_device.stdout is defined and item|trim != ""
with_items:
- "{{ has_wifi_device.stdout_lines }}"
- include_tasks: wifi.yml
when: has_wireless is defined
- include_tasks: raspberry_pi.yml
when: first_run and rpi_model != "none"

View file

@ -38,29 +38,18 @@
- name: '2021-07-27: SEE ALSO 4-5 networking packages LATER installed by https://github.com/iiab/iiab/blob/master/roles/2-common/tasks/network.yml'
meta: noop
# 2021-07-27 explanation from @jvonau: The 3 BELOW (iw, rfkill, wireless-tools)
# are provided by RasPiOS. Ubuntu|Debian on the other hand are hit or miss:
# desktops might have some/all 3 preinstalled, while servers tend not to have
# these present at all, but are needed to be installed if you want to take full
# advantage of WiFi on Ubuntu and friends -- but it's only enforced on RPi
# hardware where we know in advance of the likelihood of WiFi being present.
# 2022-03-15: This section is effectively now useless on RasPiOS (but apparently
# serves a purpose on Ubuntu on RPi, where it installs dphys-swapfile and
# fake-hwclock). Still: @jvonau's above explanation of other OS's / other HW
# suggest this code should possibly move in future, to helps others too?
- name: 'Install packages: dphys-swapfile, fake-hwclock, iw, rfkill, wireless-tools'
- name: 'Install packages: dphys-swapfile, fake-hwclock'
package:
name:
- dphys-swapfile # 2021-03-15: For Ubuntu on RPi? RasPiOS installs this regardless -- autogenerate and use a swap file
- fake-hwclock # 2021-03-15: For Ubuntu on RPi? RasPiOS installs this regardless -- save/restore system clock on machines without working RTC hardware
- iw # 2021-07-27: RasPiOS installs this regardless -- configure Linux wireless devices -- hard dependence for ap0 creation, SEE https://github.com/iiab/iiab/blob/master/roles/network/templates/hostapd/iiab-clone-wifi.service.j2
- rfkill # 2021-07-27: RasPiOS installs this regardless -- enable & disable wireless devices
- wireless-tools # 2021-07-27: RasPiOS installs this regardless -- manipulate Linux Wireless Extensions
state: present
- name: Increase swap file size (to CONF_SWAPSIZE={{ pi_swap_file_size }} in /etc/dphys-swapfile) as kalite pip download fails
lineinfile:
path: /etc/dphys-swapfile

View file

@ -0,0 +1,13 @@
# 2021-07-27 explanation from @jvonau: The 3 BELOW (iw, rfkill, wireless-tools)
# are provided by RaspiOS. Ubuntu|Debian on the other hand are hit or miss:
# desktops might have some/all 3 preinstalled, while servers tend not to have
# these present at all, but are needed to be installed if you want to take full
# advantage of WiFi on Ubuntu and friends
- name: 'Install packages: iw, rfkill, wireless-tools'
package:
name:
- iw # 2021-07-27: RaspiOS installs this regardless -- configure Linux wireless devices -- hard dependence for ap0 creation, SEE https://github.com/iiab/iiab/blob/master/roles/network/templates/hostapd/iiab-clone-wifi.service.j2
- rfkill # 2021-07-27: RaspiOS installs this regardless -- enable & disable wireless devices
- wireless-tools # 2021-07-27: RaspiOS installs this regardless -- manipulate Linux Wireless Extensions
state: present