From 410ce50a599436b442e90d9a16da77e05dd16f18 Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Wed, 12 May 2021 17:13:33 +0200 Subject: [PATCH] make album download work --- .gitignore | 1 + all.yml | 18 ++++++----------- music.yml | 20 +++++++++++-------- roles/music/files/albums.txt | 1 - roles/music/tasks/download_music.yml | 12 +++++++++-- .../tasks/download_music_requirements.yml | 8 -------- roles/music/tasks/funkwhale.yml | 2 +- 7 files changed, 30 insertions(+), 32 deletions(-) delete mode 100644 roles/music/files/albums.txt diff --git a/.gitignore b/.gitignore index b593a85..6b708d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .vault_password +albums.txt diff --git a/all.yml b/all.yml index 345c7d2..efa6de0 100644 --- a/all.yml +++ b/all.yml @@ -3,23 +3,17 @@ become: yes roles: - role: base - tags: - - base + tags: base - role: cron - tags: - - cron + tags: cron - role: ufw - tags: - - ufw + tags: ufw - role: fail2ban - tags: - - fail2ban + tags: fail2ban - role: node-exporter - tags: - - node-exporter + tags: node-exporter - role: docker - tags: - - docker + tags: docker - role: traefik tags: - docker diff --git a/music.yml b/music.yml index 6a5f2a3..39965ed 100644 --- a/music.yml +++ b/music.yml @@ -6,23 +6,27 @@ include_role: name: music tasks_from: download_music_requirements - tags: - - requirements + apply: + tags: requirements + tags: requirements - name: Install and configure Funkwhale include_role: name: music tasks_from: funkwhale - tags: - - install + apply: + tags: install + tags: install - name: Download submitted list of albums include_role: name: music tasks_from: download_music - tags: - - download + apply: + tags: download + tags: download - name: Import music into Funkwhale include_role: name: music tasks_from: import_music - tags: - - import + apply: + tags: import + tags: import diff --git a/roles/music/files/albums.txt b/roles/music/files/albums.txt deleted file mode 100644 index 76207b7..0000000 --- a/roles/music/files/albums.txt +++ /dev/null @@ -1 +0,0 @@ -https://www.deezer.com/fr/album/42024091 diff --git a/roles/music/tasks/download_music.yml b/roles/music/tasks/download_music.yml index 3df277f..9758b25 100644 --- a/roles/music/tasks/download_music.yml +++ b/roles/music/tasks/download_music.yml @@ -1,8 +1,16 @@ +- name: Update deezloader configuration file + template: + src: deezloader_settings.ini.j2 + dest: "{{ deezloader_folder_path }}/setting.ini" + owner: "{{ base_user_name }}" + group: "{{ base_user_name }}" + mode: 0644 + - name: Download required albums shell: - argv: "deez-dw.py --recursive_download True --recursive_quality True --output {{ deezloader_songs_path }} --not_gui False --link {{ item }}" + cmd: "deez-dw.py --recursive_download True --recursive_quality True --output {{ deezloader_songs_path }} --not_gui False --link {{ item }}" chdir: "{{ deezloader_folder_path }}" - with_lines: "cat files/albums.txt" + with_items: "{{ lookup('file', 'files/albums.txt').splitlines() }}" register: output_deezloader - name: Show download state diff --git a/roles/music/tasks/download_music_requirements.yml b/roles/music/tasks/download_music_requirements.yml index 0302ad5..c39ac13 100644 --- a/roles/music/tasks/download_music_requirements.yml +++ b/roles/music/tasks/download_music_requirements.yml @@ -19,14 +19,6 @@ - "{{ deezloader_songs_path }}" - "{{ beets_config_folder }}" -- name: Update deezloader configuration file - template: - src: deezloader_settings.ini.j2 - dest: "{{ deezloader_folder_path }}/settings.ini" - owner: "{{ base_user_name }}" - group: "{{ base_user_name }}" - mode: 0644 - - name: Update beets configuration file template: src: beets_config.yaml.j2 diff --git a/roles/music/tasks/funkwhale.yml b/roles/music/tasks/funkwhale.yml index d11de75..9e2f3f7 100644 --- a/roles/music/tasks/funkwhale.yml +++ b/roles/music/tasks/funkwhale.yml @@ -7,7 +7,7 @@ group: "{{ base_user_name }}" mode: 0755 -- name: Copy Traefik templates (nginx conf and Compose) +- name: Copy Funkwhale templates (nginx conf and Compose) template: src: "{{ item }}" # Remove .j2 extension