2020-09-22 17:17:34 +00:00
|
|
|
- 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
|
2020-08-02 18:36:56 +00:00
|
|
|
|
2020-09-22 17:17:34 +00:00
|
|
|
- name: 'Install from template: check-firmware.service, iiab-check-firmware & fw_warn.sh'
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
2020-08-02 18:36:56 +00:00
|
|
|
dest: "{{ item.dest }}"
|
2020-09-22 17:17:34 +00:00
|
|
|
mode: "{{ item.mode }}"
|
2020-08-02 18:36:56 +00:00
|
|
|
with_items:
|
2020-09-22 17:17:34 +00:00
|
|
|
- { src: 'check-firmware.service', dest: '/etc/systemd/system/', mode: '0644' }
|
|
|
|
- { src: 'iiab-check-firmware', dest: '/usr/sbin/', mode: '0755' }
|
|
|
|
- { src: 'fw_warn.sh', dest: '/etc/profile.d/', mode: '0644' }
|
|
|
|
|
|
|
|
- name: Enable & (Re)Start check-firmware.service (also runs on each boot)
|
|
|
|
systemd:
|
|
|
|
name: check-firmware.service
|
|
|
|
daemon_reload: yes
|
|
|
|
state: restarted
|
|
|
|
enabled: yes
|
2020-08-02 18:36:56 +00:00
|
|
|
|
2020-08-09 13:21:29 +00:00
|
|
|
|
2020-09-22 17:17:34 +00:00
|
|
|
# RECORD firmware AS INSTALLED
|
2020-08-09 13:21:29 +00:00
|
|
|
|
2020-09-22 17:17:34 +00:00
|
|
|
- name: "Set 'firmware_installed: True'"
|
2020-08-09 13:21:29 +00:00
|
|
|
set_fact:
|
2020-09-22 17:17:34 +00:00
|
|
|
firmware_installed: True
|
2020-08-09 13:21:29 +00:00
|
|
|
|
2020-09-22 17:17:34 +00:00
|
|
|
- name: "Add 'firmware_installed: True' to {{ iiab_state_file }}"
|
2020-08-02 18:36:56 +00:00
|
|
|
lineinfile:
|
|
|
|
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
2020-09-22 17:17:34 +00:00
|
|
|
regexp: '^firmware_installed'
|
|
|
|
line: 'firmware_installed: True'
|
|
|
|
|
|
|
|
# SEE ALSO firmware_downloaded above & in download.yml
|