Files
ansible/roles/pi_sysdweb/tasks/main.yml
Martin Bauer cb0ece0478 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>
2026-10-02 23:14:18 +02:00

64 lines
2.1 KiB
YAML

---
- name: Apt install python3-pip
ansible.builtin.apt:
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
executable: pip3
extra_args: "--break-system-packages"
notify: Restart sysdweb-system
- name: Sysdweb user
ansible.builtin.user:
name: sysdweb
shell: /usr/bin/nologin
password: "$6$TcTD23xOXln$RxN3Kd0vJRaxffoyKqjoBJM0Q5Va6REBVZ6BOgmGXs3fTAWc7voSW5QcN35t9pfro2do0LeSaeGsrMLbArZ.2."
update_password: always
- name: Configure sysdweb user
ansible.builtin.blockinfile:
path: /etc/sysdweb.conf
create: true
mode: "0644"
marker: "# {mark} ansible user"
block: |
[DEFAULT]
users = sysdweb
notify: Restart sysdweb-system
- name: Configure sysdweb
ansible.builtin.blockinfile:
path: /etc/sysdweb.conf
create: true
mode: "0644"
marker: "# {mark} ansible managed for {{ pi_sysdweb_name }}"
block: |
[{{ pi_sysdweb_name }}]
title = {{ pi_sysdweb_name }}
unit = {{ pi_sysdweb_name }}.service
notify: Restart sysdweb-system
- name: Install systemd service file
ansible.builtin.copy:
src: sysdweb-system.service
dest: /etc/systemd/system/
mode: "0644"
notify: Restart sysdweb-system
- name: Enable sysdweb autostart
ansible.builtin.systemd:
name: sysdweb-system
state: started
enabled: "yes"
daemon_reload: "yes"