Add Debian Bookworm support and refactor Pi OS detection (#415)

* Refactor Pi OS detection and add Debian Bookworm support

* Add bullseye back

---------

Co-authored-by: Techno Tim <timothystewart6@gmail.com>
This commit is contained in:
sholdee 2024-01-25 13:20:02 -06:00 committed by GitHub
parent df9c6f3014
commit 511c410451
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,21 +17,19 @@
when: when:
grep_cpuinfo_raspberrypi.rc == 0 or grep_device_tree_model_raspberrypi.rc == 0 grep_cpuinfo_raspberrypi.rc == 0 or grep_device_tree_model_raspberrypi.rc == 0
- name: Set detected_distribution to Raspbian - name: Set detected_distribution to Raspbian (ARM64 on Raspbian, Debian Buster/Bullseye/Bookworm)
set_fact:
detected_distribution: Raspbian
when: >
raspberry_pi|default(false) and
( ansible_facts.lsb.id|default("") == "Raspbian" or
ansible_facts.lsb.description|default("") is match("[Rr]aspbian.*") )
- name: Set detected_distribution to Raspbian (ARM64 on Debian Buster)
set_fact: set_fact:
detected_distribution: Raspbian detected_distribution: Raspbian
vars:
allowed_descriptions:
- "[Rr]aspbian.*"
- "Debian.*buster"
- "Debian.*bullseye"
- "Debian.*bookworm"
when: when:
- ansible_facts.architecture is search("aarch64") - ansible_facts.architecture is search("aarch64")
- raspberry_pi|default(false) - raspberry_pi|default(false)
- ansible_facts.lsb.description|default("") is match("Debian.*buster") - ansible_facts.lsb.description|default("") is match(allowed_descriptions | join('|'))
- name: Set detected_distribution_major_version - name: Set detected_distribution_major_version
set_fact: set_fact:
@ -39,14 +37,6 @@
when: when:
- detected_distribution | default("") == "Raspbian" - detected_distribution | default("") == "Raspbian"
- name: Set detected_distribution to Raspbian (ARM64 on Debian Bullseye)
set_fact:
detected_distribution: Raspbian
when:
- ansible_facts.architecture is search("aarch64")
- raspberry_pi|default(false)
- ansible_facts.lsb.description|default("") is match("Debian.*bullseye")
- name: Execute OS related tasks on the Raspberry Pi - {{ action_ }} - name: Execute OS related tasks on the Raspberry Pi - {{ action_ }}
include_tasks: "{{ item }}" include_tasks: "{{ item }}"
with_first_found: with_first_found: