mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
- name: Back up originals then download firmware (for RPi internal WiFi)
|
|
include_tasks: download.yml
|
|
when: firmware_downloaded is undefined # SEE ALSO firmware_installed below
|
|
|
|
- name: 'Install from template: /usr/bin/iiab-check-firmware, /etc/systemd/system/iiab-check-firmware.service & /etc/profile.d/iiab-firmware-warn.sh'
|
|
template:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.dest }}"
|
|
mode: "{{ item.mode }}"
|
|
with_items:
|
|
- { src: 'iiab-check-firmware', dest: '/usr/bin/', mode: '0755' }
|
|
- { src: 'iiab-check-firmware.service', dest: '/etc/systemd/system/', mode: '0644' }
|
|
- { src: 'iiab-firmware-warn.sh', dest: '/etc/profile.d/', mode: '0644' }
|
|
|
|
- name: Enable & (Re)Start iiab-check-firmware.service (also runs on each boot)
|
|
systemd:
|
|
name: iiab-check-firmware.service
|
|
daemon_reload: yes
|
|
state: restarted
|
|
enabled: yes
|
|
|
|
|
|
# RECORD firmware AS INSTALLED
|
|
|
|
- name: "Set 'firmware_installed: True'"
|
|
set_fact:
|
|
firmware_installed: True
|
|
|
|
- name: "Add 'firmware_installed: True' to {{ iiab_state_file }}"
|
|
lineinfile:
|
|
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
|
regexp: '^firmware_installed'
|
|
line: 'firmware_installed: True'
|
|
|
|
# SEE ALSO firmware_downloaded above & in download.yml
|