|
4 | 4 | register: spotify_soloist_arch |
5 | 5 | changed_when: false |
6 | 6 | check_mode: false |
| 7 | + tags: argh |
| 8 | + |
| 9 | +- name: Check if Spotify arch is compatible |
| 10 | + ansible.builtin.fail: |
| 11 | + msg: Seems no binary for your Architecture is available from Spotify |
| 12 | + when: spotify_soloist_arch.stdout not in spotify_soloist_supported_arches |
| 13 | + tags: argh |
7 | 14 |
|
8 | 15 | - name: Fetch Spotify soloist |
9 | 16 | ansible.builtin.get_url: |
|
17 | 24 | ansible.builtin.unarchive: |
18 | 25 | src: /usr/local/bin/spotify_soloist.tar.gz |
19 | 26 | dest: /usr/local/bin/ |
| 27 | + include: soloist |
20 | 28 | remote_src: true |
21 | 29 | when: not ansible_check_mode |
22 | 30 |
|
|
46 | 54 | enabled: true |
47 | 55 | scope: user |
48 | 56 | when: not ansible_check_mode |
| 57 | + |
| 58 | +- name: Template Spotify soloist download service |
| 59 | + ansible.builtin.template: |
| 60 | + src: spotify_soloist_reinstall.service.j2 |
| 61 | + dest: /etc/systemd/system/spotify_soloist_reinstall.service |
| 62 | + owner: media |
| 63 | + group: media |
| 64 | + mode: '600' |
| 65 | + when: not ansible_check_mode |
| 66 | + tags: create_soloist_service |
| 67 | + |
| 68 | +- name: Template Spotify soloist download restart script |
| 69 | + ansible.builtin.template: |
| 70 | + src: templates/soloist_refresh.sh.j2 |
| 71 | + dest: /usr/local/bin/soloist_refresh.sh |
| 72 | + owner: root |
| 73 | + group: root |
| 74 | + mode: '700' |
| 75 | + when: not ansible_check_mode |
| 76 | + notify: Reload systemd |
| 77 | + tags: argh |
| 78 | + |
| 79 | +- name: Template Spotify soloist download timer and service |
| 80 | + ansible.builtin.template: |
| 81 | + src: "templates/{{ item }}" |
| 82 | + dest: /etc/systemd/system/{{ item|regex_replace(".j2","") }} |
| 83 | + owner: root |
| 84 | + group: root |
| 85 | + mode: '600' |
| 86 | + when: not ansible_check_mode |
| 87 | + notify: Reload systemd |
| 88 | + loop: |
| 89 | + - "spotify_soloist_reinstall.timer.j2" |
| 90 | + - "spotify_soloist_reinstall.service.j2" |
| 91 | + tags: argh |
| 92 | + |
| 93 | +- name: Enable Schedule soloist download timer |
| 94 | + become: true |
| 95 | + ansible.builtin.systemd: |
| 96 | + name: spotify_soloist_reinstall.timer |
| 97 | + state: started |
| 98 | + enabled: true |
| 99 | + when: not ansible_check_mode |
| 100 | + tags: argh |
| 101 | + notify: Reload systemd |
0 commit comments