pi_standard_setup, pi_hifiberry_amp and pi_disable_onboard_bluetooth each defined a handler called "Reboot". Handler names are play-global, so a notify ran only the last one defined - pi_disable_onboard_bluetooth's - and with that role's `when:`. On every host where onboard Bluetooth stays on, the handler was skipped and nothing that asked for a reboot ever got one: not a changed dtoverlay, not a hostname change, not the Pi 5 kernel. Seen on musicdolphin, where a new HiFiBerry overlay sat unapplied in config.txt after a clean run. Each role now notifies a handler only it defines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
929 B
YAML
24 lines
929 B
YAML
---
|
|
- name: Deactivate normal audio
|
|
ansible.builtin.lineinfile:
|
|
path: /boot/config.txt
|
|
regexp: "^#?dtparam=audio=on"
|
|
line: "#dtparam=audio=on"
|
|
notify: Reboot after HiFiBerry boot config change
|
|
- name: Activate Hifiberry
|
|
ansible.builtin.lineinfile:
|
|
path: /boot/firmware/config.txt
|
|
regexp: "^#?dtoverlay=hifiberry-amp"
|
|
line: "dtoverlay={{ hifiberry_overlay }}"
|
|
notify: Reboot after HiFiBerry boot config change
|
|
- name: Lift the Pi 5's USB current cap when the HiFiBerry board powers it
|
|
# A Pi 5 fed over the GPIO header has no USB-C power negotiation, so it assumes a
|
|
# weak supply and limits USB ports to 600mA. Unknown to a Pi 4, which ignores it.
|
|
ansible.builtin.lineinfile:
|
|
path: /boot/firmware/config.txt
|
|
regexp: "^#?usb_max_current_enable="
|
|
line: "usb_max_current_enable=1"
|
|
insertafter: EOF
|
|
when: hifiberry_powers_pi
|
|
notify: Reboot after HiFiBerry boot config change
|