2022-03-15 16:17:51 +00:00
- name : Install packages 'parted' and 'cloud-guest-utils' (so /usr/bin/growpart is available for expanding rootfs partition during boot)
2022-03-15 14:24:30 +00:00
package :
2022-03-15 16:17:51 +00:00
name :
- parted # 2022-03-15 : RasPiOS and Ubuntu install this regardless -- so rarely nec but just in case.
2022-03-15 18:38:42 +00:00
- 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.
2022-03-15 14:24:30 +00:00
state : present
- name : "Install from templates: /usr/sbin/iiab-expand-rootfs, /etc/systemd/system/iiab-expand-rootfs.service"
template :
src : "{{ item.src }}"
dest : "{{ item.dest }}"
mode : "{{ item.mode }}"
with_items :
- { src: 'iiab-expand-rootfs', dest: '/usr/sbin/', mode : '0755' }
- { src: 'iiab-expand-rootfs.service', dest: '/etc/systemd/system/', mode : '0644' }
- name : Enable /etc/systemd/system/iiab-expand-rootfs.service
systemd :
name : iiab-expand-rootfs
enabled : yes
2021-07-31 20:43:29 +00:00
## DISCOVER PLATFORMS ######
# Put conditional actions for hardware platforms here
2022-03-15 17:47:39 +00:00
- 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
2021-07-31 20:43:29 +00:00
- include_tasks : raspberry_pi.yml
when : first_run and rpi_model != "none"
2022-03-15 14:24:30 +00:00
2021-07-31 20:43:29 +00:00
- name : Check if the identifier for Intel's NUC6 built-in WiFi is present
shell : "lsusb | grep 8087:0a2b | wc | awk '{print $1}'"
register : usb_NUC6
ignore_errors : True
2022-03-15 14:24:30 +00:00
- name : Download {{ iiab_download_url }}/iwlwifi-8000C-13.ucode to /lib/firmware for built-in WiFi on NUC6
2021-07-31 20:43:29 +00:00
get_url :
2022-03-15 14:24:30 +00:00
url : "{{ iiab_download_url }}/iwlwifi-8000C-13.ucode" # http://download.iiab.io/packages
2021-07-31 20:43:29 +00:00
dest : /lib/firmware
timeout : "{{ download_timeout }}"
2021-08-29 18:36:48 +00:00
when : usb_NUC6.stdout|int > 0