mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-26 10:15:14 +00:00
Airsonic now starts/stops
This commit is contained in:
parent
75c3ae23da
commit
c200bf18b6
4 changed files with 44 additions and 30 deletions
1
nas.yml
1
nas.yml
|
@ -44,7 +44,6 @@
|
|||
- role: airsonic
|
||||
tags:
|
||||
- airsonic
|
||||
when: (airsonic_enabled | default(False))
|
||||
|
||||
- role: bazarr
|
||||
tags:
|
||||
|
|
|
@ -13,3 +13,6 @@ airsonic_hostname: "airsonic"
|
|||
|
||||
# specs
|
||||
airsonic_memory: 1g
|
||||
|
||||
# docker
|
||||
airsonic_container_name: airsonic
|
||||
|
|
9
roles/airsonic/handlers/main.yml
Normal file
9
roles/airsonic/handlers/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
- name: Stop Airsonic
|
||||
docker_container:
|
||||
name: "{{ airsonic_container_name }}"
|
||||
state: absent
|
||||
when: airsonic_enabled is false
|
||||
listen:
|
||||
- "stop airsonic"
|
||||
- "stop disabled applications"
|
|
@ -1,31 +1,34 @@
|
|||
---
|
||||
- name: Create Airsonic Directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
# mode: 0755
|
||||
with_items:
|
||||
- "{{ airsonic_data_directory }}/data"
|
||||
- "{{ airsonic_data_directory }}/playlists"
|
||||
- name: Airsonic
|
||||
block:
|
||||
- name: Create Airsonic Directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
# mode: 0755
|
||||
with_items:
|
||||
- "{{ airsonic_data_directory }}/data"
|
||||
- "{{ airsonic_data_directory }}/playlists"
|
||||
|
||||
- name: Airsonic Docker Container
|
||||
docker_container:
|
||||
name: airsonic
|
||||
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"
|
||||
- name: Airsonic Docker Container
|
||||
docker_container:
|
||||
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"
|
||||
when: airsonic_enabled is true
|
||||
|
|
Loading…
Reference in a new issue