mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-12 11:38:47 +00:00
rename misnamed calibre role to calibreweb
This commit is contained in:
parent
68352004f3
commit
1e3c150fff
16 changed files with 160 additions and 160 deletions
4
nas.yml
4
nas.yml
|
@ -61,9 +61,9 @@
|
||||||
tags:
|
tags:
|
||||||
- calibre
|
- calibre
|
||||||
|
|
||||||
- role: calibremanager
|
- role: calibreweb
|
||||||
tags:
|
tags:
|
||||||
- calibremanager
|
- calibreweb
|
||||||
|
|
||||||
- role: cloudcmd
|
- role: cloudcmd
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -1,22 +1,26 @@
|
||||||
---
|
---
|
||||||
calibre_enabled: false
|
calibre_enabled: false
|
||||||
calibre_available_externally: false
|
calibre_available_externally: "false"
|
||||||
|
|
||||||
# uid / gid
|
# uid / gid
|
||||||
calibre_user_id: "0"
|
calibre_user_id: "1000"
|
||||||
calibre_group_id: "0"
|
calibre_group_id: "1000"
|
||||||
|
|
||||||
# directories
|
# directories
|
||||||
calibre_data_directory: "{{ docker_home }}/calibre"
|
calibre_data_directory: "{{ docker_home }}/calibre"
|
||||||
calibre_books_root: "{{ books_root }}"
|
calibre_books_directory: "{{ books_root }}"
|
||||||
|
calibre_comics_directory: "{{ comics_root }}"
|
||||||
# other
|
|
||||||
calibre_ebook_conversion: "linuxserver/calibre-web:calibre"
|
|
||||||
|
|
||||||
# network
|
# network
|
||||||
calibre_port: "8084"
|
calibre_port: "8093"
|
||||||
|
calibre_webserver_port: "8094"
|
||||||
calibre_hostname: "calibre"
|
calibre_hostname: "calibre"
|
||||||
|
|
||||||
|
# env
|
||||||
|
calibre_password: ""
|
||||||
|
calibre_cli_args: ""
|
||||||
|
calibre_security_opts: "seccomp=unconfined" # For why this is here, see https://github.com/linuxserver/docker-calibre/issues/102
|
||||||
|
|
||||||
# specs
|
# specs
|
||||||
calibre_memory: 1g
|
calibre_memory: 1g
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,3 @@ provisioner:
|
||||||
group_vars:
|
group_vars:
|
||||||
all:
|
all:
|
||||||
calibre_enabled: true
|
calibre_enabled: true
|
||||||
calibre_port: "8085" # 8084 is used by github actions
|
|
||||||
|
|
|
@ -1,43 +1,47 @@
|
||||||
---
|
---
|
||||||
- name: Start Calibre
|
- name: Start Calibre Manager
|
||||||
block:
|
block:
|
||||||
- name: Create Calibre-web Directories
|
- name: Create Calibre Manager Directories
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
mode: 0755
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ calibre_data_directory }}/config"
|
- "{{ calibre_data_directory }}/data"
|
||||||
|
|
||||||
- name: Calibre-web Docker Container
|
- name: Calibre Docker Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ calibre_container_name }}"
|
name: "{{ calibre_container_name }}"
|
||||||
image: linuxserver/calibre-web:latest
|
image: linuxserver/calibre
|
||||||
pull: true
|
pull: true
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ calibre_data_directory }}/config:/config"
|
- "{{ calibre_data_directory }}/data:/config:rw"
|
||||||
- "{{ calibre_books_root }}:/books"
|
- "{{ calibre_books_directory }}:/books:rw"
|
||||||
- "{{ calibre_data_directory }}/data:/data"
|
- "{{ calibre_comics_directory }}:/comics:rw"
|
||||||
env:
|
env:
|
||||||
TZ: "{{ ansible_nas_timezone }}"
|
TZ: "{{ ansible_nas_timezone }}"
|
||||||
PUID: "{{ calibre_user_id }}"
|
PUID: "{{ calibre_user_id }}"
|
||||||
PGID: "{{ calibre_group_id }}"
|
PGID: "{{ calibre_group_id }}"
|
||||||
DOCKER_MODS: "{{ calibre_ebook_conversion }}"
|
PASSWORD: "{{ calibre_password }}"
|
||||||
|
CLI_ARGS: "{{ calibre_cli_args }}"
|
||||||
ports:
|
ports:
|
||||||
- "{{ calibre_port }}:8083"
|
- "{{ calibre_port }}:8080"
|
||||||
|
- "{{ calibre_webserver_port }}:8081"
|
||||||
|
security_opts: "{{ calibre_security_opts }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
memory: "{{ calibre_memory }}"
|
memory: "{{ calibre_memory }}"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "{{ calibre_available_externally | string }}"
|
traefik.enable: "{{ calibre_available_externally | string }}"
|
||||||
traefik.http.routers.calibre.rule: "Host(`calibre.{{ ansible_nas_domain }}`)"
|
traefik.http.routers.calibre.rule: "Host(`{{ calibre_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.calibre.tls.certresolver: "letsencrypt"
|
traefik.http.routers.calibre.tls.certresolver: "letsencrypt"
|
||||||
traefik.http.routers.calibre.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
traefik.http.routers.calibre.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||||
traefik.http.routers.calibre.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.calibre.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
traefik.http.services.calibre.loadbalancer.server.port: "8083"
|
traefik.http.services.calibre.loadbalancer.server.port: "8080"
|
||||||
when: calibre_enabled is true
|
when: calibre_enabled is true
|
||||||
|
|
||||||
- name: Stop Calibre
|
- name: Stop Calibre Manager
|
||||||
block:
|
block:
|
||||||
- name: Stop Calibre
|
- name: Stop Calibre Manager
|
||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ calibre_container_name }}"
|
name: "{{ calibre_container_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
---
|
|
||||||
calibremanager_enabled: false
|
|
||||||
calibremanager_available_externally: "false"
|
|
||||||
|
|
||||||
# uid / gid
|
|
||||||
calibremanager_user_id: "1000"
|
|
||||||
calibremanager_group_id: "1000"
|
|
||||||
|
|
||||||
# directories
|
|
||||||
calibremanager_data_directory: "{{ docker_home }}/calibremanager"
|
|
||||||
calibremanager_books_directory: "{{ books_root }}"
|
|
||||||
calibremanager_comics_directory: "{{ comics_root }}"
|
|
||||||
|
|
||||||
# network
|
|
||||||
calibremanager_port: "8093"
|
|
||||||
calibremanager_webserver_port: "8094"
|
|
||||||
calibremanager_hostname: "calibremanager"
|
|
||||||
|
|
||||||
# env
|
|
||||||
calibremanager_password: ""
|
|
||||||
calibremanager_cli_args: ""
|
|
||||||
calibremanager_security_opts: "seccomp=unconfined" # For why this is here, see https://github.com/linuxserver/docker-calibre/issues/102
|
|
||||||
|
|
||||||
# specs
|
|
||||||
calibremanager_memory: 1g
|
|
||||||
|
|
||||||
# docker
|
|
||||||
calibremanager_container_name: calibremanager
|
|
|
@ -1,6 +0,0 @@
|
||||||
---
|
|
||||||
provisioner:
|
|
||||||
inventory:
|
|
||||||
group_vars:
|
|
||||||
all:
|
|
||||||
calibremanager_enabled: true
|
|
|
@ -1,48 +0,0 @@
|
||||||
---
|
|
||||||
- name: Start Calibre Manager
|
|
||||||
block:
|
|
||||||
- name: Create Calibre Manager Directories
|
|
||||||
file:
|
|
||||||
path: "{{ item }}"
|
|
||||||
state: directory
|
|
||||||
mode: 0755
|
|
||||||
with_items:
|
|
||||||
- "{{ calibremanager_data_directory }}/data"
|
|
||||||
|
|
||||||
- name: Calibre Docker Container
|
|
||||||
docker_container:
|
|
||||||
name: "{{ calibremanager_container_name }}"
|
|
||||||
image: linuxserver/calibre
|
|
||||||
pull: true
|
|
||||||
volumes:
|
|
||||||
- "{{ calibremanager_data_directory }}/data:/config:rw"
|
|
||||||
- "{{ calibremanager_books_directory }}:/books:rw"
|
|
||||||
- "{{ calibremanager_comics_directory }}:/comics:rw"
|
|
||||||
env:
|
|
||||||
TZ: "{{ ansible_nas_timezone }}"
|
|
||||||
PUID: "{{ calibremanager_user_id }}"
|
|
||||||
PGID: "{{ calibremanager_group_id }}"
|
|
||||||
PASSWORD: "{{ calibremanager_password }}"
|
|
||||||
CLI_ARGS: "{{ calibremanager_cli_args }}"
|
|
||||||
ports:
|
|
||||||
- "{{ calibremanager_port }}:8080"
|
|
||||||
- "{{ calibremanager_webserver_port }}:8081"
|
|
||||||
security_opts: "{{ calibremanager_security_opts }}"
|
|
||||||
restart_policy: unless-stopped
|
|
||||||
memory: "{{ calibremanager_memory }}"
|
|
||||||
labels:
|
|
||||||
traefik.enable: "{{ calibremanager_available_externally | string }}"
|
|
||||||
traefik.http.routers.calibremanager.rule: "Host(`{{ calibremanager_hostname }}.{{ ansible_nas_domain }}`)"
|
|
||||||
traefik.http.routers.calibremanager.tls.certresolver: "letsencrypt"
|
|
||||||
traefik.http.routers.calibremanager.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
||||||
traefik.http.routers.calibremanager.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
|
||||||
traefik.http.services.calibremanager.loadbalancer.server.port: "8080"
|
|
||||||
when: calibremanager_enabled is true
|
|
||||||
|
|
||||||
- name: Stop Calibre Manager
|
|
||||||
block:
|
|
||||||
- name: Stop Calibre Manager
|
|
||||||
docker_container:
|
|
||||||
name: "{{ calibremanager_container_name }}"
|
|
||||||
state: absent
|
|
||||||
when: calibremanager_enabled is false
|
|
24
roles/calibreweb/defaults/main.yml
Normal file
24
roles/calibreweb/defaults/main.yml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
calibreweb_enabled: false
|
||||||
|
calibreweb_available_externally: false
|
||||||
|
|
||||||
|
# uid / gid
|
||||||
|
calibreweb_user_id: "0"
|
||||||
|
calibreweb_group_id: "0"
|
||||||
|
|
||||||
|
# directories
|
||||||
|
calibreweb_data_directory: "{{ docker_home }}/calibreweb"
|
||||||
|
calibreweb_books_root: "{{ books_root }}"
|
||||||
|
|
||||||
|
# other
|
||||||
|
calibreweb_ebook_conversion: "linuxserver/calibre-web:calibre"
|
||||||
|
|
||||||
|
# network
|
||||||
|
calibreweb_port: "8084"
|
||||||
|
calibreweb_hostname: "calibreweb"
|
||||||
|
|
||||||
|
# specs
|
||||||
|
calibreweb_memory: 1g
|
||||||
|
|
||||||
|
# docker
|
||||||
|
calibreweb_container_name: calibreweb
|
7
roles/calibreweb/molecule/default/molecule.yml
Normal file
7
roles/calibreweb/molecule/default/molecule.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
provisioner:
|
||||||
|
inventory:
|
||||||
|
group_vars:
|
||||||
|
all:
|
||||||
|
calibreweb_enabled: true
|
||||||
|
calibreweb_port: "8085" # 8084 is used by github actions
|
|
@ -7,4 +7,4 @@
|
||||||
include_role:
|
include_role:
|
||||||
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
|
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
|
||||||
vars:
|
vars:
|
||||||
calibremanager_enabled: false
|
calibreweb_enabled: false
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
- name: Get container state
|
- name: Get container state
|
||||||
docker_container_info:
|
docker_container_info:
|
||||||
name: "{{ calibremanager_container_name }}"
|
name: "{{ calibreweb_container_name }}"
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- name: Check Calibre is running
|
- name: Check Calibre is running
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
- name: Try and stop and remove Calibre
|
- name: Try and stop and remove Calibre
|
||||||
docker_container:
|
docker_container:
|
||||||
name: "{{ calibremanager_container_name }}"
|
name: "{{ calibreweb_container_name }}"
|
||||||
state: absent
|
state: absent
|
||||||
register: result
|
register: result
|
||||||
|
|
44
roles/calibreweb/tasks/main.yml
Normal file
44
roles/calibreweb/tasks/main.yml
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
---
|
||||||
|
- name: Start Calibre
|
||||||
|
block:
|
||||||
|
- name: Create Calibre-web Directories
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ calibreweb_data_directory }}/config"
|
||||||
|
|
||||||
|
- name: Calibre-web Docker Container
|
||||||
|
docker_container:
|
||||||
|
name: "{{ calibreweb_container_name }}"
|
||||||
|
image: linuxserver/calibre-web:latest
|
||||||
|
pull: true
|
||||||
|
volumes:
|
||||||
|
- "{{ calibreweb_data_directory }}/config:/config"
|
||||||
|
- "{{ calibreweb_books_root }}:/books"
|
||||||
|
- "{{ calibreweb_data_directory }}/data:/data"
|
||||||
|
env:
|
||||||
|
TZ: "{{ ansible_nas_timezone }}"
|
||||||
|
PUID: "{{ calibreweb_user_id }}"
|
||||||
|
PGID: "{{ calibreweb_group_id }}"
|
||||||
|
DOCKER_MODS: "{{ calibreweb_ebook_conversion }}"
|
||||||
|
ports:
|
||||||
|
- "{{ calibreweb_port }}:8083"
|
||||||
|
restart_policy: unless-stopped
|
||||||
|
memory: "{{ calibreweb_memory }}"
|
||||||
|
labels:
|
||||||
|
traefik.enable: "{{ calibreweb_available_externally | string }}"
|
||||||
|
traefik.http.routers.calibreweb.rule: "Host(`{{ calibreweb_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
|
traefik.http.routers.calibreweb.tls.certresolver: "letsencrypt"
|
||||||
|
traefik.http.routers.calibreweb.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||||
|
traefik.http.routers.calibreweb.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
|
traefik.http.services.calibreweb.loadbalancer.server.port: "8083"
|
||||||
|
when: calibreweb_enabled is true
|
||||||
|
|
||||||
|
- name: Stop Calibre
|
||||||
|
block:
|
||||||
|
- name: Stop Calibre
|
||||||
|
docker_container:
|
||||||
|
name: "{{ calibreweb_container_name }}"
|
||||||
|
state: absent
|
||||||
|
when: calibreweb_enabled is false
|
39
website/docs/applications/media-serving/calibre-web.md
Normal file
39
website/docs/applications/media-serving/calibre-web.md
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
---
|
||||||
|
title: "Calibre-web"
|
||||||
|
---
|
||||||
|
|
||||||
|
Homepage: <https://github.com/janeczku/calibre-web>
|
||||||
|
|
||||||
|
Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Set `calibreweb_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
|
||||||
|
|
||||||
|
## Specific Configuration
|
||||||
|
|
||||||
|
Requires Calibre ebook management program. Available for download [here](https://calibre-ebook.com/download).
|
||||||
|
|
||||||
|
### Admin login
|
||||||
|
|
||||||
|
**Default admin login:** Username: admin Password: admin123
|
||||||
|
|
||||||
|
### eBook Conversion
|
||||||
|
|
||||||
|
If you do not need eBook conversion you can disable it to save resources by setting the `calibreweb_ebook_conversion` variable in `group_vars/all.yml` file to be empty.
|
||||||
|
|
||||||
|
- Conversion enabled: `calibreweb_ebook_conversion: "linuxserver/calibre-web:calibre"`
|
||||||
|
|
||||||
|
- Conversion disabled: `calibreweb_ebook_conversion: ""`
|
||||||
|
|
||||||
|
You can target just Calibre by appending `-t calibre` to your `ansible-playbook` command.
|
||||||
|
|
||||||
|
## Use with Calibre
|
||||||
|
|
||||||
|
Ansible-NAS add [../calibre](Calibre) long after Calibre-web. To allow Calibre-web direct access to the Calibre database, both applications can share a Docker data directory. To do so, include the following in your inventory `nas.yml`:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
calibreweb_data_directory: "{{ docker_home }}/calibre"
|
||||||
|
```
|
||||||
|
|
||||||
|
In this case, the Calibre Database Directory is `/data/Calibre Library`.
|
|
@ -1,10 +1,8 @@
|
||||||
---
|
# Calibre
|
||||||
title: "Calibre-web"
|
|
||||||
---
|
|
||||||
|
|
||||||
Homepage: <https://github.com/janeczku/calibre-web>
|
Homepage: [https://calibre-ebook.com](https://calibre-ebook.com)
|
||||||
|
|
||||||
Calibre-Web is a web app providing a clean interface for browsing, reading and downloading eBooks using an existing Calibre database.
|
Calibre is a powerful and easy to use e-book manager.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -12,18 +10,15 @@ Set `calibre_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
|
||||||
|
|
||||||
## Specific Configuration
|
## Specific Configuration
|
||||||
|
|
||||||
Requires Calibre ebook management program. Available for download [here](https://calibre-ebook.com/download).
|
By default, there is no password set for the main gui. Optional `calibre_password` will allow setting a password for the user `abc`.
|
||||||
|
|
||||||
### Admin login
|
Optionally, cli start arguments can be passed to calibre using `calibre_cli_args`.
|
||||||
|
|
||||||
**Default admin login:** Username: admin Password: admin123
|
The Calibre webserver must be turned on in the Calibre manager to make it available at the selected port (8094 by default).
|
||||||
|
|
||||||
### eBook Conversion
|
## Ports
|
||||||
|
|
||||||
If you do not need eBook conversion you can disable it to save resources by setting the `calibre_ebook_conversion` variable in `group_vars/all.yml` file to be empty.
|
```yml
|
||||||
|
calibre_port: "8093"
|
||||||
- Conversion enabled: `calibre_ebook_conversion: "linuxserver/calibre-web:calibre"`
|
calibre_webserver_port: "8094"
|
||||||
|
```
|
||||||
- Conversion disabled: `calibre_ebook_conversion: ""`
|
|
||||||
|
|
||||||
You can target just Calibre by appending `-t calibre` to your `ansible-playbook` command.
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
# Calibre
|
|
||||||
|
|
||||||
Homepage: [https://calibre-ebook.com](https://calibre-ebook.com)
|
|
||||||
|
|
||||||
Calibre is a powerful and easy to use e-book manager.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Set `calibremanager_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
|
|
||||||
|
|
||||||
## Specific Configuration
|
|
||||||
|
|
||||||
By default, there is no password set for the main gui. Optional `calibremanager_password` will allow setting a password for the user `abc`.
|
|
||||||
|
|
||||||
Optionally, cli start arguments can be passed to calibre using `calibremanager_cli_args`.
|
|
||||||
|
|
||||||
The Calibre webserver must be turned on in the Calibre manager to make it available at the selected port (8094 by default).
|
|
||||||
|
|
||||||
## Use with Calibre-web
|
|
||||||
|
|
||||||
Ansible-NAS has long come with [../calibre](Calibre-web). To allow Calibre-web direct access to the Calibre database, both applications can share a Docker data directory. To do so, include the following in your inventory `nas.yml`:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
calibremanager_data_directory: "{{ docker_home }}/calibre"
|
|
||||||
```
|
|
||||||
|
|
||||||
In this case, the Calibre Database Directory is `/data/Calibre Library`
|
|
||||||
|
|
||||||
## Ports
|
|
||||||
|
|
||||||
```yml
|
|
||||||
calibremanager_port: "8093"
|
|
||||||
calibremanager_webserver_port: "8094"
|
|
||||||
```
|
|
Loading…
Reference in a new issue