Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ by default in anonymous mode allowing anyone on your network to stream to your d
| spotify_connect_name:| my-hifi | no |


## spotify-soloist
Installs & configures official spotify-connect compatible client
by default in anonymous mode allowing anyone on your network to stream to your device


| Variable name | Example | Mandatory |
| -------------------- |:-------------:| :----------:|
| spotify_soloist_api_key | | yes|
| spotify_connect_name:| my-hifi | no |


## roc_streaming
Installs the roc sink modules for pulseaudio allowing streaming audio from
any pulseaudio/pipewire sound server giving a apple air-share like streaming experience
Expand Down
15 changes: 15 additions & 0 deletions roles/spotify_soloist/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Reload systemd
become: false
remote_user: media
ansible.builtin.systemd:
daemon_reload: true
scope: user

- name: Restart Spotify soloist
become: false
remote_user: media
ansible.builtin.systemd:
service: spotify_soloist
state: restarted
scope: user
48 changes: 48 additions & 0 deletions roles/spotify_soloist/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
- name: Deduce OS architecture
ansible.builtin.command: dpkg --print-architecture
register: spotify_soloist_arch
changed_when: false
check_mode: false

- name: Fetch Spotify soloist
ansible.builtin.get_url:
url: https://soloist-builds.spotifycdn.com/soloist_release_{{ spotify_soloist_arch.stdout }}.tar.gz
dest: /usr/local/bin/spotify_soloist.tar.gz
owner: media
group: media
mode: '600'

- name: Unarchive spotify soloist
ansible.builtin.unarchive:
src: /usr/local/bin/spotify_soloist.tar.gz
dest: /usr/local/bin/
remote_src: true
when: not ansible_check_mode

- name: Remove Spotify-soloist archive file
ansible.builtin.file:
path: /usr/local/bin/spotify_soloist.tar.gz
state: absent
when: not ansible_check_mode

- name: Create Spotify soloist service
ansible.builtin.template:
src: spotify_soloist.service.j2
dest: /home/media/.config/systemd/user/spotify_soloist.service
owner: media
group: media
mode: '600'
notify: Reload systemd
when: not ansible_check_mode
tags: create_soloist_service

- name: Enable Spotify soloist service
become: false
remote_user: media
ansible.builtin.systemd:
name: spotify_soloist
state: started
enabled: true
scope: user
when: not ansible_check_mode
15 changes: 15 additions & 0 deletions roles/spotify_soloist/templates/spotify_soloist.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Spotifys official headless spotify-connect client
Documentation=https://developer.spotify.com/documentation/soloist

After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/local/bin/soloist -k {{ spotify_soloist_api_key }} -n {% if spotify_connect_name is defined %}{{ spotify_connect_name }}{% else %}{{ inventory_hostname }}{% endif %}

Restart=always
RestartSec=10

[Install]
WantedBy=default.target
Loading