Add mpd setup
This commit is contained in:
parent
26562383cb
commit
5911d7ace4
11 changed files with 185 additions and 2 deletions
|
|
@ -0,0 +1,88 @@
|
|||
- name: set up sudoers configuration
|
||||
become: yes
|
||||
template:
|
||||
src: "sudoers.j2"
|
||||
dest: "/etc/sudoers.d/10-sonny"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
|
||||
- name: copy systemd configuration files
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
loop:
|
||||
- {
|
||||
src: "mpd/service.j2",
|
||||
dest: "{{ xdg_config_dir }}/systemd/user/mpd.service",
|
||||
}
|
||||
- {
|
||||
src: "mpd/socket.j2",
|
||||
dest: "{{ xdg_config_dir }}/systemd/user/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: "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: "mpd/music_mount.j2",
|
||||
dest: "{{ xdg_script_dir }}/music_mount",
|
||||
}
|
||||
- {
|
||||
src: "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
|
||||
systemd:
|
||||
name: mpd.socket
|
||||
state: started
|
||||
enabled: yes
|
||||
scope: user
|
||||
when: platform == "desktop"
|
||||
Loading…
Add table
Add a link
Reference in a new issue