Booksonic starts and stops

This commit is contained in:
David Stephens 2022-08-28 16:43:58 +01:00
parent b8fcfd30c0
commit ca36ac0701
4 changed files with 48 additions and 34 deletions

View file

@ -56,7 +56,6 @@
- role: booksonic - role: booksonic
tags: tags:
- booksonic - booksonic
when: (booksonic_enabled | default(False))
- role: calibre - role: calibre
tags: tags:

View file

@ -17,3 +17,6 @@ booksonic_hostname: "booksonic"
# specs # specs
booksonic_memory: 1g booksonic_memory: 1g
# docker
booksonic_container_name: booksonic

View file

@ -0,0 +1,9 @@
---
- name: Stop Booksonic
docker_container:
name: "{{ booksonic_container_name }}"
state: absent
when: booksonic_enabled is false
listen:
- "stop booksonic"
- "stop disabled applications"

View file

@ -1,4 +1,6 @@
--- ---
- name: Booksonic
block:
- name: Create Booksonic Directories - name: Create Booksonic Directories
file: file:
path: "{{ item }}" path: "{{ item }}"
@ -10,7 +12,7 @@
- name: Booksonic Docker Container - name: Booksonic Docker Container
docker_container: docker_container:
name: booksonic name: "{{ booksonic_container_name }}"
image: linuxserver/booksonic-air:latest image: linuxserver/booksonic-air:latest
pull: true pull: true
volumes: volumes:
@ -33,3 +35,4 @@
traefik.http.routers.booksonic.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.booksonic.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.booksonic.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" traefik.http.routers.booksonic.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.booksonic.loadbalancer.server.port: "4040" traefik.http.services.booksonic.loadbalancer.server.port: "4040"
when: booksonic_enabled is true