Repository navigation
Expand file tree
/
Copy pathmain.yml
More file actions
101 lines (91 loc) · 2.73 KB
/
Copy pathmain.yml
File metadata and controls
101 lines (91 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
- name: Deduce OS architecture
ansible.builtin.command: dpkg --print-architecture
register: spotify_soloist_arch
changed_when: false
check_mode: false
tags: argh
- name: Check if Spotify arch is compatible
ansible.builtin.fail:
msg: Seems no binary for your Architecture is available from Spotify
when: spotify_soloist_arch.stdout not in spotify_soloist_supported_arches
tags: argh
- 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/
include: soloist
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
- name: Template Spotify soloist download service
ansible.builtin.template:
src: spotify_soloist_reinstall.service.j2
dest: /etc/systemd/system/spotify_soloist_reinstall.service
owner: media
group: media
mode: '600'
when: not ansible_check_mode
tags: create_soloist_service
- name: Template Spotify soloist download restart script
ansible.builtin.template:
src: templates/soloist_refresh.sh.j2
dest: /usr/local/bin/soloist_refresh.sh
owner: root
group: root
mode: '700'
when: not ansible_check_mode
notify: Reload systemd
tags: argh
- name: Template Spotify soloist download timer and service
ansible.builtin.template:
src: "templates/{{ item }}"
dest: /etc/systemd/system/{{ item|regex_replace(".j2","") }}
owner: root
group: root
mode: '600'
when: not ansible_check_mode
notify: Reload systemd
loop:
- "spotify_soloist_reinstall.timer.j2"
- "spotify_soloist_reinstall.service.j2"
tags: argh
- name: Enable Schedule soloist download timer
become: true
ansible.builtin.systemd:
name: spotify_soloist_reinstall.timer
state: started
enabled: true
when: not ansible_check_mode
tags: argh
notify: Reload systemd