[FW] Use Compose module rather than shell for importing music
This is because for no reason, the shell module will just hang, never launching the container. This is also a bit cleaner...master
parent
499770ef34
commit
9ed4e33a7d
|
@ -25,11 +25,25 @@
|
||||||
|
|
||||||
- name: Import music into Funkwhale
|
- name: Import music into Funkwhale
|
||||||
shell:
|
shell:
|
||||||
# funkwhale_import_music_directory is the mounted version of tagged
|
|
||||||
# files at previous step
|
|
||||||
cmd: "docker-compose run --rm api python manage.py import_files {{ funkwhale_import_library_id }} {{ funkwhale_import_music_directory }} --recursive --noinput --prune"
|
cmd: "docker-compose run --rm api python manage.py import_files {{ funkwhale_import_library_id }} {{ funkwhale_import_music_directory }} --recursive --noinput --prune"
|
||||||
chdir: "{{ funkwhale_folder_name }}"
|
chdir: "{{ funkwhale_folder_name }}"
|
||||||
|
|
||||||
|
- name: Run funkwhale import container
|
||||||
|
community.docker.docker_compose:
|
||||||
|
project_src: "{{ funkwhale_folder_name }}"
|
||||||
|
files: ["import.yml"]
|
||||||
|
remove_orphans: yes
|
||||||
|
pull: yes
|
||||||
|
recreate: smart
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Remove funkwhale import container
|
||||||
|
community.docker.docker_compose:
|
||||||
|
project_src: "{{ funkwhale_folder_name }}"
|
||||||
|
files: ["import.yml"]
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Delete files once imported
|
- name: Delete files once imported
|
||||||
shell:
|
shell:
|
||||||
cmd: "rm -rf {{ funkwhale_import_music_directory_host }}/*"
|
cmd: "rm -rf {{ funkwhale_import_music_directory_host }}/*"
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
loop:
|
loop:
|
||||||
- docker-compose.yml.j2
|
- docker-compose.yml.j2
|
||||||
|
- import.yml.j2
|
||||||
- conf.env.j2
|
- conf.env.j2
|
||||||
- nginx.conf.j2
|
- nginx.conf.j2
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
version: "{{ compose_version }}"
|
||||||
|
|
||||||
|
services:
|
||||||
|
api:
|
||||||
|
image: "funkwhale/funkwhale:{{ funkwhale_version }}"
|
||||||
|
container_name: funkwhale_import
|
||||||
|
env_file:
|
||||||
|
- ./conf.env
|
||||||
|
volumes:
|
||||||
|
- "{{ funkwhale_import_music_directory_host }}:{{ funkwhale_import_music_directory }}:ro"
|
||||||
|
- "static:{{ funkwhale_static_root }}"
|
||||||
|
- "frontend:{{ funkwhale_frontend }}"
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
command: ["python", "manage.py", "import_files", "{{ funkwhale_import_library_id }}", "{{ funkwhale_import_music_directory }}", "--recursive", "--noinput", "--prune"]
|
||||||
|
restart: no
|
Loading…
Reference in New Issue