ansible/roles/desktop-common/tasks/mopidy.yml
2020-08-08 20:37:28 -05:00

47 lines
1.1 KiB
YAML

#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Configure system packages
block:
- name: Add mopidy repo key
apt_key:
url: "https://apt.mopidy.com/mopidy.gpg"
- name: Add repos
apt_repository:
repo: "{{ item }}"
loop:
# These repos work for Buster and >=19.10
- "deb https://apt.mopidy.com/ buster main contrib non-free"
- "deb-src https://apt.mopidy.com/ buster main contrib non-free"
- name: Update APT cache
apt:
update_cache: yes
cache_valid_time: 86400
- name: Install packages
apt:
name:
- mpc
- mopidy
- mopidy-mpd
- mopidy-spotify
- name: Template out config
block:
- name: Create config directory
file:
path: "~/.config/mopidy"
state: directory
mode: "0755"
- name: Template out config
template:
src: mopidy.conf
mode: "0600"
dest: "~/.config/mopidy/mopidy.conf"
become_user: "{{ user_username }}"
become: yes
- name: Remove MPD
apt:
name:
- mpd
state: absent
become: yes