Add new pulseaudio role

It's like system mode but not
This commit is contained in:
Salt 2020-09-16 14:28:02 -05:00
parent c351c32c05
commit 8aa0027bfa
7 changed files with 57 additions and 3 deletions

View File

@ -40,6 +40,8 @@
38306234316364306134396138376230626630633733306432626637616239373838646433343761
3436643661633766616564663937346232353666386531363438
tags: [ desktop ]
- role: pulseaudio
tags: [ pulse, pulseaudio ]
- role: desktop-sddm
vars:
sddm_theme_name: "breeze"

View File

@ -23,9 +23,6 @@
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
loop:
- { src: "pulse-client.conf", dest: "/etc/pulse/client.conf", mode: "0644" }
- { src: "pulse-daemon.conf", dest: "/etc/pulse/daemon.conf", mode: "0644" }
- { src: "pulse-default.pa", dest: "/etc/pulse/default.pa", mode: "0644" }
- { src: "sshd_config", dest: "/etc/ssh/sshd_config", mode: "0644" }
- { src: "nomouseaccel.conf", dest: "/etc/X11/xorg.conf.d/90-mouse-acceleration.conf", mode: "0644" }
- { src: "touchpad.conf", dest: "/etc/X11/xorg.conf.d/90-touchpad.conf", mode: "0644" }

View File

@ -0,0 +1,32 @@
#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Install and configure PulseAudio
block:
- name: Install packages
apt:
name:
- pulseaudio
- name: Template out configs
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
mode: "{{ item.mode }}"
loop:
- { src: "pulse-client.conf", dest: "/etc/pulse/client.conf", mode: "0644" }
- { src: "pulse-daemon.conf", dest: "/etc/pulse/daemon.conf", mode: "0644" }
- { src: "pulse-default.pa", dest: "/etc/pulse/default.pa", mode: "0644" }
- { src: "pulseaudio.service", dest: "/etc/systemd/system/pulseaudio.service", mode: "0644" }
- name: Assure pulse user
user:
name: pulseaudio
password: "!"
system: yes
home: /var/lib/pulse
groups: audio
- name: Enable service
systemd:
name: pulseaudio
enabled: yes
daemon_reload: yes
become: yes

View File

@ -0,0 +1,23 @@
# vim:ft=systemd
# NOTE: This service is ONLY useful IF you have the following:
# * client.conf is set to not autospawn and listen to a socket instead
# * default.pa is configured to start such a socket
# Using this unit file and complaining to me that it doesn't work without
# the other configs in place will result in me not giving a shit
## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE
## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE
## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE
## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE
## THIS UNIT DOES NOT START PULSE IN SYSTEM MODE
[Unit]
Description=Pulseaudio sound server
[Service]
User=pulseaudio
Group=pulseaudio
ExecStart=/usr/bin/pulseaudio --disallow-exit
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target