fletort.rpi_noobs_recovery
Role Name
This role is used to recover a Raspberry Pi.
It automatically performs a headless recovery (reflash) of a Raspberry Pi. You can specify which operating system (OS) to flash before starting the process.
Requirements
This role is designed for a Raspberry Pi that already has NOOBS and an OS installed.
The OS to be recovered can be downloaded from the NOOBS repository (or a compatible one).
The Raspberry Pi you are targeting must accept SSH connections.
Role Variables
noobs_main_partition
The main partition for NOOBS on the Raspberry Pi. The default value is
/dev/mmcblk0p1.noobs_repo_server
A list of NOOBS repositories, which are URLs pointing to OS list files. The default value is the official NOOBS OS list:
["http://downloads.raspberrypi.org/os_list_v3.json"].requested_os_name
The name of the OS you want to install. The default value is
Raspberry Pi OS Lite (32-bit). You can find the name in the descriptions of the OS lists.requested_os_release_date
The release date of the OS to install. In the NOOBS OS list, versions are tracked using this information. The default value is
latest, which means it will always auto-update to the latest release. The latest release will be downloaded automatically when it is detected.
Dependencies
None.
Example Playbook
Simple Example
- hosts: servers
roles:
- role: fletort.rpi-noobs-recovery
This playbook will recover the Raspberry Pi using the latest version of Raspberry Pi OS Lite (32-bit). It will check for new versions each time the playbook runs.
Install Only a Specific OS Release
- hosts: servers
roles:
- role: fletort.rpi-noobs-recovery
vars:
requested_os_name: "OSMC_Pi2"
requested_os_release_date: "2020-10-18"
This playbook will always restore the 2020-10-18 release of OSMC_Pi2. If that version is not available locally, it will be downloaded from the default repository. Once it's available locally, there will be no further downloads.
Note: If it isn't available locally or in the repository, an error will occur.
Install from a Specific Repository
- hosts: servers
roles:
- role: fletort.rpi-noobs-recovery
vars:
noobs_repo_server:
- "http://downloads.raspberrypi.org/os_list_v3.json"
- "http://myserver.com/my_os_list.json"
requested_os_name: "my beautiful os"
This playbook adds a personal repository to the list of sources.
A specific OS, from this repository, called my beautiful os, will be installed.
License
MIT / BSD
ansible-galaxy install fletort.rpi_noobs_recovery