ansible/roles/music/tasks/download_music.yml

39 lines
1.1 KiB
YAML
Raw Normal View History

2021-10-13 17:53:07 +02:00
- name: Update deemix configuration file
2021-05-12 17:13:33 +02:00
template:
2021-10-13 17:53:07 +02:00
src: deemix_config.json.j2
dest: "{{ deemix_folder_path }}/config/config.json"
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
- name: Update ARL token file
template:
src: arl.j2
dest: "{{ deemix_folder_path }}/config/.arl"
2021-05-12 17:13:33 +02:00
owner: "{{ base_user_name }}"
group: "{{ base_user_name }}"
mode: 0644
- name: Filter non-existing albums
shell:
chdir: ~/documents/code/funkwhale-playlist-import
cmd: ./exclude-existing-albums.py -s deezer > /tmp/unique_albums.txt
stdin: "{{ lookup('file', 'files/albums.txt') }}"
register: unique_albums
delegate_to: localhost
become: false
- name: Download required albums
# So that files are written with base user perms
become: true
become_user: "{{ base_user_name }}"
shell:
2021-10-13 17:53:07 +02:00
cmd: "deemix --portable -p {{ deemix_songs_path }} {{ item }}"
chdir: "{{ deemix_folder_path }}"
with_items: "{{ lookup('file', '/tmp/unique_albums.txt').splitlines() }}"
2021-10-13 17:53:07 +02:00
register: output_deemix
- name: Show download state
debug:
2021-10-13 17:53:07 +02:00
msg: "{{ output_deemix }}"