-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup_calibre_web.yml
46 lines (42 loc) · 1.25 KB
/
setup_calibre_web.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
- name: Set up Calibre-Web
hosts: nuc
become: yes
tasks:
- name: Create bind mounts
file:
path: "{{ item }}"
state: directory
loop:
- /home/rex/calibre
- /home/rex/calibre/config
- /home/rex/calibre/books # put books here
become: no
- name: Deploy Calibre Web container
docker_container:
name: calibre
image: lscr.io/linuxserver/calibre-web:latest
env:
PUID: "1000"
PGID: "1000"
TZ: "Asia/Taipei"
DOCKER_MODS: "linuxserver/mods:universal-calibre"
OAUTHLIB_RELAX_TOKEN_SCOPE: "1"
volumes:
- "/home/rex/calibre/config:/config"
- "/home/rex/calibre/books:/books"
ports:
- "8083:8083"
restart_policy: unless-stopped
- name: Wait for init
community.docker.docker_container_exec:
container: calibre
command: |
bash -c "while ! type calibredb &> /dev/null; do sleep 1; done;"
changed_when: False
- name: Prepare database
community.docker.docker_container_exec:
container: calibre
command: |
bash -c "mkdir /calibre-library; \
calibredb add /books/ -r --with-library=/calibre-library/"