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

Cleaner internal-wifi.yml + install-expand-rootfs.yml

This commit is contained in:
root 2022-03-15 22:17:36 -04:00
parent 566bef36c8
commit 67ebb0b2a1
2 changed files with 9 additions and 8 deletions

View file

@ -1,7 +1,7 @@
- name: Install packages 'parted' and 'cloud-guest-utils' (so /usr/bin/growpart is available for expanding rootfs partition during boot) - name: Install packages 'parted' and 'cloud-guest-utils' (for /usr/bin/growpart, though raspi-config uses fdisk)
package: package:
name: name:
- parted # 2022-03-15: RasPiOS and Ubuntu install this regardless -- so rarely nec but just in case. - parted # 2022-03-15: RasPiOS and Ubuntu install this regardless -- so rarely nec, but just in case.
- cloud-guest-utils # 2022-03-15: For growpart command -- though RasPiOS currently doesn't need this, as raspi-config's do_expand_rootfs() instead uses fdisk. Ubuntu pre-installs cloud-guest-utils, for use with cloud-init. - cloud-guest-utils # 2022-03-15: For growpart command -- though RasPiOS currently doesn't need this, as raspi-config's do_expand_rootfs() instead uses fdisk. Ubuntu pre-installs cloud-guest-utils, for use with cloud-init.
state: present state: present
@ -14,7 +14,7 @@
- { src: 'iiab-expand-rootfs', dest: '/usr/sbin/', mode: '0755' } - { src: 'iiab-expand-rootfs', dest: '/usr/sbin/', mode: '0755' }
- { src: 'iiab-expand-rootfs.service', dest: '/etc/systemd/system/', mode: '0644' } - { src: 'iiab-expand-rootfs.service', dest: '/etc/systemd/system/', mode: '0644' }
- name: Enable /etc/systemd/system/iiab-expand-rootfs.service - name: Enable iiab-expand-rootfs.service
systemd: systemd:
name: iiab-expand-rootfs name: iiab-expand-rootfs
enabled: yes enabled: yes

View file

@ -1,13 +1,14 @@
- name: Look for any wireless devices present - name: "Look for any WiFi devices present: ls -la /sys/class/net/*/phy80211 | cut -d/ -f5"
shell: ls -la /sys/class/net/*/phy80211 | cut -d/ -f5 shell: ls -la /sys/class/net/*/phy80211 | cut -d/ -f5
register: has_wifi_device register: wifi_devices
ignore_errors: True ignore_errors: True
changed_when: False changed_when: False
- name: Set internal_wifi, if found - name: "Set internal_wifi: True, if output (from above) shows device(s) here: {{ wifi_devices.stdout_lines }}"
set_fact: set_fact:
internal_wifi: True internal_wifi: True
when: has_wifi_device is defined and has_wifi_device.stdout | trim != "" when: wifi_devices is defined and wifi_devices.stdout_lines | length > 0
# when: wifi_devices is defined and wifi_devices.stdout | trim != ""
# 2021-07-27 explanation from @jvonau: The 3 BELOW (iw, rfkill, wireless-tools) # 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: # are provided by RasPiOS. Ubuntu|Debian on the other hand are hit or miss:
@ -15,7 +16,7 @@
# these present at all, but are needed to be installed if you want to take full # these present at all, but are needed to be installed if you want to take full
# advantage of WiFi on Ubuntu and friends. # advantage of WiFi on Ubuntu and friends.
- name: 'Install packages: iw, rfkill, wireless-tools' - name: Install packages {iw, rfkill, wireless-tools} if internal_wifi ({{ internal_wifi }}) is defined
package: package:
name: 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 - 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