Several roles reported "changed" on every playbook run even when
nothing on the target had drifted, making real config drift
indistinguishable from noise:
- 7 systemd tasks across 6 roles used state:restarted, which always
issues a restart and always reports changed. Switched to
state:started plus notify-driven handlers that only restart when
the underlying unit file, script, or config actually changes.
- pi_standard_setup's boot mode, timezone, and locale tasks shelled
out to raspi-config with changed_when:true hardcoded. Boot mode now
checks systemctl get-default first; timezone/locale now use the
natively idempotent community.general.timezone/locale_gen modules.
- The pi account password task computed password_hash('sha512')
without a seed, generating a new random salt (and thus an
apparently different hash) on every run. Added a stable seed so the
hash only changes when the underlying secret does.
Also renamed a mislabeled task in pi_squeezelite_custom and fixed a
typo in pi_standard_setup while those files were already touched.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
---
|
|
- name: Apt install python3-pip
|
|
ansible.builtin.apt:
|
|
name: python3-pip
|
|
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"
|