Keep the media-pi roles working on trixie

- pi_hifiberry_amp: the boot config lives at /boot/firmware/config.txt.
- pi_sysdweb: install python3-dbus and python3-systemd from apt, which trixie ships at
  the versions sysdweb needs; bookworm gets the headers pip needs to build dbus-python
  1.4 itself.
- pi_squeezeserver: trixie images have no iptables, and so cannot have the port 80
  redirect that absent.yml removes - skip that step there instead of failing.
- pi_modern_shell_env, pi_slint_frontend: read facts through `ansible_facts` rather than
  the deprecated injected `ansible_*` variables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 23:14:18 +02:00
parent e3722d2648
commit cb0ece0478
5 changed files with 25 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
---
- name: Deactivate normal audio
ansible.builtin.lineinfile:
path: /boot/config.txt
path: /boot/firmware/config.txt
regexp: "^#?dtparam=audio=on"
line: "#dtparam=audio=on"
notify: Reboot after HiFiBerry boot config change

View File

@@ -34,7 +34,7 @@
# build: TLS handshake fails with SSL_ERROR_SYSCALL), while Ansible's
# get_url (Python urllib) succeeds against the same CDN. Download the
# binary directly instead of shelling out to the install script.
url: "https://cdn.ohmyposh.dev/releases/latest/posh-linux-{{ pi_modern_shell_env_ohmyposh_arch_map[ansible_architecture] }}"
url: "https://cdn.ohmyposh.dev/releases/latest/posh-linux-{{ pi_modern_shell_env_ohmyposh_arch_map[ansible_facts['architecture']] }}"
dest: /usr/local/bin/oh-my-posh
mode: "0755"

View File

@@ -102,7 +102,7 @@
# codegen-units=1 is a memory risk on 1.8 GB and buys nothing that matters here.
CARGO_PROFILE_RELEASE_LTO: "false"
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"
PATH: "/root/.cargo/bin:{{ ansible_env.PATH }}"
PATH: "/root/.cargo/bin:{{ ansible_facts['env']['PATH'] }}"
async: 7200
poll: 30
changed_when: true

View File

@@ -36,7 +36,17 @@
state: absent
notify: Restart sysdweb after dropping the LMS entry
- name: Check whether iptables is installed
# Trixie images ship nftables only. A host without iptables cannot have the redirect
# below (present.yml installs iptables-persistent), so there is nothing to undo.
ansible.builtin.command: which iptables
register: pi_squeezeserver_iptables
changed_when: false
failed_when: false
check_mode: false # read-only
- name: Undo the port 80 -> 9000 redirect the install added
when: pi_squeezeserver_iptables.rc == 0
ansible.builtin.iptables:
table: nat
chain: PREROUTING

View File

@@ -4,6 +4,18 @@
name: python3-pip
cache_valid_time: 7200
state: present
- name: Apt install sysdweb's dbus and systemd dependencies
# sysdweb needs dbus-python ~= 1.4, which PyPI only ships as source (meson build needing
# pkg-config and the dbus/glib headers), and systemd-python, which needs libsystemd-dev.
# Trixie packages both (python3-dbus is exactly 1.4, python3-systemd 235), and pip counts
# the apt versions as satisfied. Bookworm has dbus 1.3, so there pip has to build 1.4.
ansible.builtin.apt:
name: >-
{{ ['python3-dbus', 'python3-systemd']
+ (['build-essential', 'pkg-config', 'python3-dev', 'libdbus-1-dev', 'libglib2.0-dev', 'libsystemd-dev']
if ansible_facts.distribution_major_version | int < 13 else []) }}
cache_valid_time: 7200
state: present
- name: Install sysdweb
ansible.builtin.pip:
name: sysdweb