client-pull-installation/roles/base/tasks/audio.yml

44 lines
1.2 KiB
YAML

---
# Manages reactivation of pulseaudio as system daemon
- name: "Allowing pulseaudio to run at startup"
replace:
regexp: '^#start on runlevel'
replace: 'start on runlevel [2345]'
dest: /etc/init/pulseaudio.conf
- name: Starting pulseaudio service
service:
name: pulseaudio
state: started
sudo: yes
- name: "Configuring client options"
lineinfile:
line: '{{ item }}'
dest: /etc/pulse/client.conf
state: present
with_items:
- 'default-server = /var/run/pulse/native'
- 'autospawn = no'
- name: Disabling pulseaudio startup on lightdm
shell: chmod -x /usr/bin/start-pulseaudio-x11
sudo: yes
# Need to manage additions to pulse and pulse-access groups
- name: Copying script to manage users in pulse and pulse-access
copy:
src: pulseaudio-perms.sh
dest: '/var/lib/{{ ansible_local.domain.domainfull }}/bin/pulseaudio-perms.sh'
mode: 0755
owner: root
group: root
- name: Adding pulseaudio fixing script at reboot.
lineinfile:
line: '@reboot root /var/lib/{{ ansible_local.domain.domainfull }}/bin/pulseaudio-perms.sh >/dev/null 2>&1'
dest: /etc/cron.d/pulseaudio-perms
create: yes
state: present