2019-01-03 15:10:39 +00:00
|
|
|
---
|
2022-08-30 22:59:52 +00:00
|
|
|
- name: Start Airsonic
|
2022-08-28 15:10:35 +00:00
|
|
|
block:
|
2022-08-30 22:59:52 +00:00
|
|
|
- name: Create Airsonic Directories
|
2023-04-15 13:11:49 +00:00
|
|
|
ansible.builtin.file:
|
2022-08-30 22:59:52 +00:00
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ airsonic_data_directory }}/data"
|
|
|
|
- "{{ airsonic_data_directory }}/playlists"
|
2019-01-03 15:10:39 +00:00
|
|
|
|
2022-08-30 22:59:52 +00:00
|
|
|
- name: Airsonic Docker Container
|
2023-04-15 13:11:49 +00:00
|
|
|
community.docker.docker_container:
|
2022-08-30 22:59:52 +00:00
|
|
|
name: "{{ airsonic_container_name }}"
|
|
|
|
image: airsonic/airsonic:latest
|
|
|
|
pull: true
|
|
|
|
volumes:
|
|
|
|
- "{{ airsonic_data_directory }}/data:/airsonic/data:rw"
|
|
|
|
- "{{ airsonic_data_directory }}/playlists:/airsonic/playlists:rw"
|
|
|
|
- "{{ airsonic_music_directory }}:/airsonic/music:rw"
|
|
|
|
- "{{ airsonic_podcasts_directory }}:/airsonic/podcasts:rw"
|
|
|
|
ports:
|
|
|
|
- "{{ airsonic_port }}:4040"
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
memory: "{{ airsonic_memory }}"
|
|
|
|
labels:
|
|
|
|
traefik.enable: "{{ airsonic_available_externally | string }}"
|
|
|
|
traefik.http.routers.airsonic.rule: "Host(`{{ airsonic_hostname }}.{{ ansible_nas_domain }}`)"
|
|
|
|
traefik.http.routers.airsonic.tls.certresolver: "letsencrypt"
|
|
|
|
traefik.http.routers.airsonic.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.airsonic.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.services.airsonic.loadbalancer.server.port: "4040"
|
2022-08-28 15:10:35 +00:00
|
|
|
when: airsonic_enabled is true
|
2022-08-30 22:59:52 +00:00
|
|
|
|
|
|
|
- name: Stop Airsonic
|
|
|
|
block:
|
|
|
|
- name: Stop Airsonic
|
2023-04-15 13:11:49 +00:00
|
|
|
community.docker.docker_container:
|
2022-08-30 22:59:52 +00:00
|
|
|
name: "{{ airsonic_container_name }}"
|
|
|
|
state: absent
|
|
|
|
when: airsonic_enabled is false
|