2021-04-27 03:16:49 +02:00
|
|
|
---
|
2021-10-13 17:53:07 +02:00
|
|
|
- name: Install deemix and beets
|
2021-05-12 17:15:08 +02:00
|
|
|
pip:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
loop:
|
2021-10-13 17:53:07 +02:00
|
|
|
- deemix
|
2021-05-12 17:15:08 +02:00
|
|
|
- beets
|
2021-05-12 18:45:18 +02:00
|
|
|
- pexpect
|
|
|
|
- pylast
|
2021-05-12 17:15:08 +02:00
|
|
|
|
2021-10-13 17:53:07 +02:00
|
|
|
- name: Create deemix and beets directories
|
2021-05-12 17:15:08 +02:00
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ base_user_name }}"
|
|
|
|
group: "{{ base_user_name }}"
|
|
|
|
mode: 0755
|
|
|
|
recurse: yes
|
|
|
|
loop:
|
2021-10-13 17:53:07 +02:00
|
|
|
- "{{ deemix_folder_path }}"
|
|
|
|
- "{{ deemix_folder_path }}/config"
|
|
|
|
- "{{ deemix_songs_path }}"
|
2021-05-12 17:15:08 +02:00
|
|
|
- "{{ beets_config_folder }}"
|
|
|
|
|
2021-04-27 03:16:49 +02:00
|
|
|
- name: Create Funkwhale directory
|
|
|
|
file:
|
|
|
|
path: "{{ funkwhale_folder_name }}"
|
|
|
|
state: directory
|
|
|
|
owner: "{{ base_user_name }}"
|
|
|
|
group: "{{ base_user_name }}"
|
|
|
|
mode: 0755
|
|
|
|
|
2021-05-12 17:13:33 +02:00
|
|
|
- name: Copy Funkwhale templates (nginx conf and Compose)
|
2021-04-27 03:16:49 +02:00
|
|
|
template:
|
|
|
|
src: "{{ item }}"
|
|
|
|
# Remove .j2 extension
|
|
|
|
dest: "{{ funkwhale_folder_name }}/{{ (item | splitext)[0] }}"
|
|
|
|
owner: "{{ base_user_name }}"
|
|
|
|
group: "{{ base_user_name }}"
|
|
|
|
mode: 0644
|
|
|
|
loop:
|
|
|
|
- docker-compose.yml.j2
|
2021-10-17 13:34:06 +02:00
|
|
|
- import.yml.j2
|
2021-04-27 03:16:49 +02:00
|
|
|
- conf.env.j2
|
|
|
|
- nginx.conf.j2
|
|
|
|
|
|
|
|
- name: Copy nginx proxy file
|
|
|
|
copy:
|
|
|
|
src: funkwhale_proxy.conf
|
|
|
|
dest: "{{ funkwhale_folder_name }}/funkwhale_proxy.conf"
|
|
|
|
owner: "{{ base_user_name }}"
|
|
|
|
group: "{{ base_user_name }}"
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: Start Funkwhale database
|
|
|
|
community.docker.docker_compose:
|
|
|
|
project_src: "{{ funkwhale_folder_name }}"
|
|
|
|
services:
|
|
|
|
- db
|
|
|
|
pull: yes
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Run migrations
|
|
|
|
shell:
|
|
|
|
cmd: docker-compose run --rm api python manage.py migrate
|
|
|
|
chdir: "{{ funkwhale_folder_name }}"
|
|
|
|
|
|
|
|
- name: Run all funkwhale containers
|
|
|
|
community.docker.docker_compose:
|
|
|
|
project_src: "{{ funkwhale_folder_name }}"
|
|
|
|
remove_orphans: yes
|
|
|
|
pull: yes
|
|
|
|
recreate: smart
|
|
|
|
state: present
|