From b47fc8657d021a0c4b7b8b726bf0204b1644a51b Mon Sep 17 00:00:00 2001 From: Phil Date: Fri, 1 Nov 2024 19:02:45 -0600 Subject: [PATCH] Add calibre and calibre-web to stack --- dns.yml | 2 ++ roles/docker/files/Caddyfile | 4 ++++ roles/docker/tasks/calibre.yml | 19 +++++++++++++++ roles/docker/tasks/main.yml | 6 ++++- roles/docker/templates/calibre-compose.yml.j2 | 24 +++++++++++++++++++ 5 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 roles/docker/tasks/calibre.yml create mode 100644 roles/docker/templates/calibre-compose.yml.j2 diff --git a/dns.yml b/dns.yml index 0f9107a..8575e04 100644 --- a/dns.yml +++ b/dns.yml @@ -19,6 +19,8 @@ ip: "152.53.36.98" - name: "audio" ip: "152.53.36.98" + - name: "books" + ip: "152.53.36.98" tasks: - name: Add A records for subdomains diff --git a/roles/docker/files/Caddyfile b/roles/docker/files/Caddyfile index 24af8b5..f429b81 100644 --- a/roles/docker/files/Caddyfile +++ b/roles/docker/files/Caddyfile @@ -6,6 +6,10 @@ pin.thesatelliteoflove.com { reverse_proxy pinry-pinry-1:80 } +books.thesatelliteoflove.com { + reverse_proxy calibre-web:8083 +} + audio.thesatelliteoflove.com { reverse_proxy audiobookshelf-audiobookshelf-1:80 } diff --git a/roles/docker/tasks/calibre.yml b/roles/docker/tasks/calibre.yml new file mode 100644 index 0000000..b75582a --- /dev/null +++ b/roles/docker/tasks/calibre.yml @@ -0,0 +1,19 @@ +- name: make calibre directories + ansible.builtin.file: + path: "{{ item}}" + state: directory + loop: + - /opt/stacks/calibre + +- name: Template out the compose file + ansible.builtin.template: + src: calibre-compose.yml.j2 + dest: /opt/stacks/calibre/compose.yml + owner: root + mode: 644 + +- name: deploy calibre stack + community.docker.docker_compose_v2: + project_src: /opt/stacks/calibre + files: + - compose.yml \ No newline at end of file diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 33d73ed..5e707a2 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -112,4 +112,8 @@ - name: Install audiobookshelf import_tasks: audiobookshelf.yml - tags: audiobookshelf \ No newline at end of file + tags: audiobookshelf + +- name: Install calibre + import_tasks: calibre.yml + tags: calibre \ No newline at end of file diff --git a/roles/docker/templates/calibre-compose.yml.j2 b/roles/docker/templates/calibre-compose.yml.j2 new file mode 100644 index 0000000..a9a1980 --- /dev/null +++ b/roles/docker/templates/calibre-compose.yml.j2 @@ -0,0 +1,24 @@ +--- +services: + calibre-web: + image: lscr.io/linuxserver/calibre-web:latest + container_name: calibre-web + environment: + - PUID=1000 + - PGID=1000 + - TZ=Etc/UTC + - DOCKER_MODS=linuxserver/mods:universal-calibre #optional + - OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional + volumes: + - config:/config + - books:/books + restart: unless-stopped +volumes: + config: + driver: local + books: + driver: local +networks: + default: + external: true + name: lava \ No newline at end of file