Always default to 'root' as a user_name if no variable has been set. This can easily happen as not every role sets the variable and instead we only set it once in the user role. Another way to possibly go about it in the future would be to inject the 'user_name' into each role that needs it as one of that role's default variables. If it is specified by the user somewhere it _should_ override those defaults, though I have to read up on the exact variable precedence.
81 lines
2.2 KiB
YAML
81 lines
2.2 KiB
YAML
- name: Ensure user group for audio/video exists
|
|
ansible.builtin.group:
|
|
name: "{{ item }}"
|
|
state: "present"
|
|
loop: "{{ audio_groups }}"
|
|
|
|
- name: Put user in audio group
|
|
ansible.builtin.user:
|
|
name: "{{ user_name | default('root') }}"
|
|
groups: "{{ audio_groups }}"
|
|
append: true
|
|
|
|
- name: Install pipewire
|
|
community.general.xbps:
|
|
name:
|
|
- pipewire
|
|
state: "{{ desired_package_state | default('present') }}"
|
|
tags: packages
|
|
|
|
- name: Install pipewire bluetooth
|
|
community.general.xbps:
|
|
name:
|
|
- libspa-bluetooth
|
|
state: "{{ desired_package_state | default('present') }}"
|
|
tags:
|
|
- packages
|
|
- bluetooth
|
|
|
|
- name: Set up wireplumber to auto start
|
|
ansible.builtin.file:
|
|
dest: "/etc/pipewire/pipewire.conf.d"
|
|
state: directory
|
|
|
|
# FIXME: Does not work automatically for some reason?
|
|
- name: Set up wireplumber to auto start
|
|
ansible.builtin.file:
|
|
force: "yes"
|
|
src: "/usr/share/examples/wireplumber/10-wireplumber.conf"
|
|
dest: "/etc/pipewire/pipewire.conf.d/10-wireplumber.conf"
|
|
state: link
|
|
|
|
- name: Enable pipewire-pulse interface
|
|
ansible.builtin.file:
|
|
force: "yes"
|
|
src: "/usr/share/examples/pipewire/20-pipewire-pulse.conf"
|
|
dest: "/etc/pipewire/pipewire.conf.d/20-pipewire-pulse.conf"
|
|
state: link
|
|
tags: pulseaudio
|
|
|
|
- name: Install alsa integration package
|
|
community.general.xbps:
|
|
name:
|
|
- alsa-pipewire
|
|
state: "{{ desired_package_state | default('present') }}"
|
|
tags:
|
|
- packages
|
|
- alsa
|
|
|
|
- name: Set up wireplumber to auto start
|
|
ansible.builtin.file:
|
|
dest: "/etc/alsa/conf.d"
|
|
state: directory
|
|
|
|
- name: Enable alsa-pipewire interface
|
|
become: true
|
|
ansible.builtin.file:
|
|
force: "yes"
|
|
src: "/usr/share/alsa/alsa.conf.d/50-pipewire.conf"
|
|
dest: "/etc/alsa/conf.d/50-pipewire.conf"
|
|
state: link
|
|
tags: alsa
|
|
|
|
- name: Make alsa-pipewire interface default for alsa
|
|
ansible.builtin.file:
|
|
force: "yes"
|
|
src: "/usr/share/alsa/alsa.conf.d/99-pipewire-default.conf"
|
|
dest: "/etc/alsa/conf.d/99-pipewire-default.conf"
|
|
state: link
|
|
tags: alsa
|
|
|
|
# TODO: Find way to install and enable pipewire-roc-sink module (and enable ~/.config/pipewire/pipewire.conf.d/roc-sink.conf)
|