Add mopidy to desktop role

This commit is contained in:
Salt 2020-06-15 08:55:51 -05:00
parent f9a8c86b9c
commit 6db1c680fa
5 changed files with 196 additions and 12 deletions

View File

@ -5,7 +5,38 @@
connection: local connection: local
roles: roles:
- common - common
- desktop - role: desktop
vars:
mopidy_spotify_username: !vault |
$ANSIBLE_VAULT;1.1;AES256
62383664346563343663636261386261383865393535646465386435663535653036636665393133
3732653236663632633863346463346164663938396137370a326535633966343430633464653437
36646134393764313338323235356634353433623731336231626238653064633332306533343966
3362303836363065610a383362313738346534313435393537343931383465623466336632323632
65656663316561333462303761613963383236363532383866313038633232373132
mopidy_spotify_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
33303165663833663839323230643036363962393164373638333334643663626235353936343861
3834633461343533353366373330323264393361323433330a623837613037346633633065613761
63303234323734623938373134333932343965336665323939306336323836613130343866343838
3633383138646233330a366634303739643237333331613436623737663463316133666230366165
36306233336134636532383232303035343533373262373431353966656561633336
mopidy_spotify_client_id: !vault |
$ANSIBLE_VAULT;1.1;AES256
32366664323864383162663963343438643930356531653064393135383364623162626533613433
6462633637396265373238383461623665393730396139320a626537353761323132386131616338
62323033666231326363616363343530333239303638626137613237393135613961613362313662
6233336234306466640a383834353935636138323837343765373966353365323634343439663435
39646138616533656361653765633161616238633335306363383030383832636330356162616264
3739646162313739646538306137623231313037386239343563
mopidy_spotify_client_secret: !vault |
$ANSIBLE_VAULT;1.1;AES256
34666538353333303865623932653237313465653363356665333336343832356530666666343266
6637653137643431346562333465323862356465303766630a336531653033393133396238326134
32393033643261373764663963353130626331646266363430353536326135663239363539613530
6265366565363862610a366561373362656637623863336665336562323838643665323461653937
38306234316364306134396138376230626630633733306432626637616239373838646433343761
3436643661633766616564663937346232353666386531363438
- role: user - role: user
vars: vars:
user_username: salt user_username: salt

View File

@ -38,6 +38,8 @@
notify: reload udev notify: reload udev
- name: Configure system packages - name: Configure system packages
include_tasks: packages.yml include_tasks: packages.yml
- name: Configure Mopidy
include_tasks: mopidy.yml
- name: Stop services - name: Stop services
systemd: systemd:
name: "{{ item }}" name: "{{ item }}"

View File

@ -0,0 +1,36 @@
#!/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
- name: Install packages
apt:
name:
- mpc
- mopidy
- mopidy-spotify
- name: Template out config
template:
src: mopidy.conf
dest: "~/.config/mopidy/mopidy.conf"
become_user: "{{ user_username }}"
become: yes
- name: Remove MPD
apt:
name:
- mpd
state: absent
become: yes

View File

@ -11,18 +11,10 @@
id: "{{ item }}" id: "{{ item }}"
loop: loop:
- "3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" # Monodevelop - "3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" # Monodevelop
- name: Add repo keys by URL
apt_key:
url: "{{ item }}"
loop:
- "https://apt.mopidy.com/mopidy.gpg" # Mopidy APT repo
- name: Add repos - name: Add repos
apt_repository: apt_repository:
repo: "{{ item }}" repo: "{{ item }}"
loop: loop:
# Mopidy
- "deb https://apt.mopidy.com/ buster main contrib non-free"
- "deb-src https://apt.mopidy.com/ buster main contrib non-free"
# Monodevelop # Monodevelop
- "deb https://download.mono-project.com/repo/ubuntu vs-bionic main" - "deb https://download.mono-project.com/repo/ubuntu vs-bionic main"
# PPAs # PPAs
@ -109,9 +101,6 @@
- lutris - lutris
- mesa-vulkan-drivers - mesa-vulkan-drivers
- monodevelop - monodevelop
- mpc
- mopidy
- mopidy-spotify
- mpv - mpv
- mupen64plus-qt - mupen64plus-qt
- nextcloud-desktop - nextcloud-desktop

View File

@ -0,0 +1,126 @@
# For further information about options in this file see:
# http://docs.mopidy.com/
#
# The initial commented out values reflect the defaults as of:
# Mopidy 2.2.3
# Mopidy-File 2.2.3
# Mopidy-HTTP 2.2.3
# Mopidy-Local 2.2.3
# Mopidy-M3U 2.2.3
# Mopidy-MPD 2.2.3
# Mopidy-SoftwareMixer 2.2.3
# Mopidy-Stream 2.2.3
#
# Available options and defaults might have changed since then,
# run `mopidy config` to see the current effective config and
# `mopidy --version` to check the current version.
[core]
#cache_dir = $XDG_CACHE_DIR/mopidy
#config_dir = $XDG_CONFIG_DIR/mopidy
#data_dir = $XDG_DATA_DIR/mopidy
#max_tracklist_length = 10000
#restore_state = false
[logging]
#color = true
#console_format = %(levelname)-8s %(message)s
#debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
#debug_file = mopidy.log
#config_file =
[audio]
#mixer = software
#mixer_volume =
#output = autoaudiosink
#buffer_time =
[proxy]
#scheme =
#hostname =
#port =
#username =
#password =
[mpd]
#enabled = true
#hostname = 127.0.0.1
#port = 6600
#password =
#max_connections = 20
#connection_timeout = 60
#zeroconf = Mopidy MPD server on $hostname
#command_blacklist =
# listall
# listallinfo
#default_playlist_scheme = m3u
[http]
enabled = false
#hostname = 127.0.0.1
#port = 6680
#static_dir =
#zeroconf = Mopidy HTTP server on $hostname
#allowed_origins =
#csrf_protection = true
[stream]
#enabled = true
#protocols =
# http
# https
# mms
# rtmp
# rtmps
# rtsp
#metadata_blacklist =
#timeout = 5000
[m3u]
#enabled = true
#base_dir = $XDG_MUSIC_DIR
#default_encoding = latin-1
#default_extension = .m3u8
#playlists_dir =
[softwaremixer]
#enabled = true
[file]
#enabled = true
#media_dirs =
# $XDG_MUSIC_DIR|Music
# ~/|Home
#excluded_file_extensions =
# .directory
# .html
# .jpeg
# .jpg
# .log
# .nfo
# .pdf
# .png
# .txt
# .zip
#show_dotfiles = false
#follow_symlinks = false
#metadata_timeout = 1000
[local]
#enabled = true
#library = json
#media_dir = $XDG_MUSIC_DIR
#scan_timeout = 1000
#scan_flush_threshold = 100
#scan_follow_symlinks = false
#excluded_file_extensions =
# .directory
# .html
# .jpeg
# .jpg
# .log
# .nfo
# .pdf
# .png
# .txt
# .zip