Setup pulse audio for remote audio

This commit is contained in:
Sonny Bakker 2021-11-21 16:58:56 +01:00
parent 470d8053bf
commit 00b7536f5e
12 changed files with 62 additions and 147 deletions

View file

@ -1,64 +1,14 @@
- name: set up sudoers configuration
become: yes
template:
src: 'templates/sudoers.j2'
dest: '/etc/sudoers.d/10-sonny'
owner: root
group: root
mode: '0644'
# remote mpd server is used now
- name: copy systemd configuration files
template:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
loop:
- {
src: 'templates/mpd/service.j2',
dest: '{{ xdg_config_dir }}/systemd/user/mpd.service',
}
- {
src: 'templates/mpd/socket.j2',
dest: '{{ xdg_config_dir }}/systemd/user/mpd.socket',
}
- name: check for mpd socket
stat:
path: '{{ xdg_config_dir }}/systemd/user/mpd.socket'
register: mpd_socket
- name: create mpd files
file:
path: '{{ item.path }}'
state: '{{ item.state }}'
loop:
- { path: '{{ mpd_configuration_dir }}', state: 'directory' }
- { path: '{{ mpd_configuration_dir }}/playlists', state: 'directory' }
- { path: '{{ mpd_configuration_dir }}/log', state: 'touch' }
- { path: '{{ mpd_configuration_dir }}/database', state: 'touch' }
- { path: '{{ mpd_configuration_dir }}/sticker.sql', state: 'touch' }
- { path: '{{ mpd_configuration_dir }}/state', state: 'touch' }
- name: copy configuration file
template:
src: 'templates/mpd/mpd.j2'
dest: '{{ mpd_configuration_dir }}/mpd.conf'
- name: copy nfs connection scripts
template:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
mode: '0755'
loop:
- { src: 'templates/mpd/music_mount.j2', dest: '{{ xdg_script_dir }}/music_mount' }
- { src: 'templates/mpd/music_umount.j2', dest: '{{ xdg_script_dir }}/music_umount' }
- name: restart mpd service
systemd:
name: mpd.service
state: restarted
enabled: no
scope: user
when: platform == "desktop"
- name: enable mpd socket
- name: disable mpd socket
systemd:
name: mpd.socket
state: started
enabled: yes
state: stopped
enabled: no
scope: user
when: platform == "desktop"
when: mpd_socket.stat.exists