Update 3 files
- /roles/audiobookshelf/tasks/main.yml - /roles/audiobookshelf/templates/docker-compose.yml.j2 - /olimp-deploy.yml
This commit is contained in:
parent
d61543aab3
commit
5e022e9b65
@ -19,6 +19,7 @@
|
||||
roles:
|
||||
- { role: docker, tags: deploy_docker }
|
||||
- { role: ampache, tags: deploy_ampache }
|
||||
- { role: audiobookshelf, tags: deploy_audiobookshelf }
|
||||
|
||||
- hosts: talk
|
||||
roles:
|
||||
|
||||
36
roles/audiobookshelf/tasks/main.yml
Normal file
36
roles/audiobookshelf/tasks/main.yml
Normal file
@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Create Audiobookshelf directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
loop:
|
||||
- "{{ audiobookshelf_base_dir }}"
|
||||
- "{{ audiobookshelf_config_dir }}"
|
||||
- "{{ audiobookshelf_db_dir }}"
|
||||
- /mnt/abooks
|
||||
- name: Deploy Audiobookshelf docker-compose.yml
|
||||
template:
|
||||
src: docker-compose.yml.j2
|
||||
dest: "{{ audiobookshelf_base_dir }}/docker-compose.yml"
|
||||
mode: 0644
|
||||
|
||||
- name: Start Audiobookshelf services
|
||||
shell: |
|
||||
cd {{ audiobookshelf_base_dir }}
|
||||
docker compose up -d
|
||||
args:
|
||||
executable: /bin/bash
|
||||
|
||||
- name: Wait for services to start
|
||||
pause:
|
||||
seconds: 15
|
||||
|
||||
- name: Check Audiobookshelf container status
|
||||
shell: docker ps --filter name=audiobookshelf
|
||||
register: audiobookshelf_status
|
||||
changed_when: false
|
||||
|
||||
- name: Show Audiobookshelf status
|
||||
debug:
|
||||
var: audiobookshelf_status.stdout
|
||||
15
roles/audiobookshelf/templates/docker-compose.yml.j2
Normal file
15
roles/audiobookshelf/templates/docker-compose.yml.j2
Normal file
@ -0,0 +1,15 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
audiobookshelf:
|
||||
image: ghcr.io/advplyr/audiobookshelf:latest
|
||||
container_name: audiobookshelf
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "{{ audiobookshelf_port }}:80"
|
||||
volumes:
|
||||
- "{{ audiobookshelf_config_dir }}:/config"
|
||||
- "{{ audiobookshelf_db_dir }}:/metadata"
|
||||
- /mnt/abooks:/audiobooks
|
||||
environment:
|
||||
- TZ={{ timezone }}
|
||||
Loading…
Reference in New Issue
Block a user