ansible/roles/pulseaudio/tasks/main.yml

22 lines
1021 B
YAML

#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
- name: assure pulse package
ansible.builtin.apt: name=pulseaudio
when: ansible_os_family == 'Debian'
- name: remove user pulseaudio services
ansible.builtin.file: state=absent path={{ item }}
loop:
- /etc/systemd/user/default.target.wants/pulseaudio.service
- /etc/systemd/user/sockets.target.wants/pulseaudio.socket
- name: template out configs
ansible.builtin.template: src={{ item.src }} dest={{ item.dest }} mode=0644
loop:
- { src: "pulse-client.conf", dest: "/etc/pulse/client.conf" }
- { src: "pulse-daemon.conf", dest: "/etc/pulse/daemon.conf" }
- { src: "pulse-default.pa", dest: "/etc/pulse/default.pa" }
- { src: "pulseaudio.service", dest: "/etc/systemd/system/pulseaudio.service" }
- name: assure pulse user
ansible.builtin.user: name=pulseaudio password="!" system=yes home=/var/lib/pulse groups=audio
- name: enable pulse service
ansible.builtin.systemd: name=pulseaudio enabled=yes state=started daemon_reload=yes