/
/
/
1---
2# Make sure the Pi has I2S and the HiFiBerry overlay (optional)
3- name: Ensure /boot/config.txt has dtparam=i2s=on
4 ansible.builtin.lineinfile:
5 path: /boot/config.txt
6 regexp: '^dtparam=i2s='
7 line: 'dtparam=i2s={{ set_dtparam_i2s | ternary("on","off") }}'
8 create: no
9 backrefs: no
10
11- name: Optionally disable onboard audio (dtparam=audio=off)
12 ansible.builtin.lineinfile:
13 path: /boot/config.txt
14 regexp: '^dtparam=audio='
15 line: 'dtparam=audio={{ disable_onboard_audio | ternary("off","on") }}'
16 create: no
17 backrefs: no
18
19- name: Ensure HiFiBerry overlay line exists
20 ansible.builtin.lineinfile:
21 path: /boot/config.txt
22 regexp: '^dtoverlay='
23 line: "dtoverlay={{ hifiberry_overlay_name }}"
24 insertafter: EOF
25 state: present
26 create: no
27
28- name: Reboot required notice
29 ansible.builtin.debug:
30 msg: "Overlay lines changed. A reboot may be required for kernel overlay changes to take effect."
31
32