2015-09-17 17:20:42 +02:00
|
|
|
---
|
|
|
|
# Manages reactivation of pulseaudio as system daemon
|
|
|
|
|
|
|
|
- name: "Allowing pulseaudio to run at startup"
|
2015-09-21 01:48:42 +02:00
|
|
|
replace:
|
2016-09-06 23:54:22 +02:00
|
|
|
regexp: '^#start on runlevel.*$'
|
2015-09-21 22:27:17 +02:00
|
|
|
replace: 'start on runlevel [2345]'
|
2015-09-17 17:20:42 +02:00
|
|
|
dest: /etc/init/pulseaudio.conf
|
|
|
|
|
2016-02-20 16:09:44 +01:00
|
|
|
- name: "Checking if pulseaudio is started"
|
|
|
|
shell: /sbin/status pulseaudio
|
|
|
|
register: pulseaudio_status
|
|
|
|
|
2015-09-17 17:25:23 +02:00
|
|
|
- name: Starting pulseaudio service
|
2016-02-20 16:09:44 +01:00
|
|
|
shell: /usr/sbin/service pulseaudio start
|
|
|
|
when: pulseaudio_status.stdout.find("start/running") == -1
|
2015-09-17 17:20:42 +02:00
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2015-09-17 17:57:25 +02:00
|
|
|
- name: Adding pulseaudio fixing script at reboot.
|
|
|
|
lineinfile:
|
2015-10-04 04:35:38 +02:00
|
|
|
line: '@reboot root curl -sSL http://{{ ansible_local.domain.serverfqdn }}/ks/preseed/pulseaudio-perms.sh | bash >/dev/null 2>&1'
|
2015-09-17 17:57:25 +02:00
|
|
|
dest: /etc/cron.d/pulseaudio-perms
|
|
|
|
create: yes
|
|
|
|
state: present
|