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:
|
||||
- calibre
|
||||
|
||||
- role: calibremanager
|
||||
- role: calibreweb
|
||||
tags:
|
||||
- calibremanager
|
||||
- calibreweb
|
||||
|
||||
- role: cloudcmd
|
||||
tags:
|
||||
|
|
|
@ -1,22 +1,26 @@
|
|||
---
|
||||
calibre_enabled: false
|
||||
calibre_available_externally: false
|
||||
calibre_available_externally: "false"
|
||||
|
||||
# uid / gid
|
||||
calibre_user_id: "0"
|
||||
calibre_group_id: "0"
|
||||
calibre_user_id: "1000"
|
||||
calibre_group_id: "1000"
|
||||
|
||||
# directories
|
||||
calibre_data_directory: "{{ docker_home }}/calibre"
|
||||
calibre_books_root: "{{ books_root }}"
|
||||
|
||||
# other
|
||||
calibre_ebook_conversion: "linuxserver/calibre-web:calibre"
|
||||
calibre_books_directory: "{{ books_root }}"
|
||||
calibre_comics_directory: "{{ comics_root }}"
|
||||
|
||||
# network
|
||||
calibre_port: "8084"
|
||||
calibre_port: "8093"
|
||||
calibre_webserver_port: "8094"
|
||||
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
|
||||
calibre_memory: 1g
|
||||
|
||||
|
|
|
@ -4,4 +4,3 @@ provisioner:
|
|||
group_vars:
|
||||
all:
|
||||
calibre_enabled: true
|
||||
calibre_port: "8085" # 8084 is used by github actions
|
||||
|
|
|
@ -1,43 +1,47 @@
|
|||
---
|
||||
- name: Start Calibre
|
||||
- name: Start Calibre Manager
|
||||
block:
|
||||
- name: Create Calibre-web Directories
|
||||
- name: Create Calibre Manager Directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
with_items:
|
||||
- "{{ calibre_data_directory }}/config"
|
||||
- "{{ calibre_data_directory }}/data"
|
||||
|
||||
- name: Calibre-web Docker Container
|
||||
- name: Calibre Docker Container
|
||||
docker_container:
|
||||
name: "{{ calibre_container_name }}"
|
||||
image: linuxserver/calibre-web:latest
|
||||
image: linuxserver/calibre
|
||||
pull: true
|
||||
volumes:
|
||||
- "{{ calibre_data_directory }}/config:/config"
|
||||
- "{{ calibre_books_root }}:/books"
|
||||
- "{{ calibre_data_directory }}/data:/data"
|
||||
- "{{ calibre_data_directory }}/data:/config:rw"
|
||||
- "{{ calibre_books_directory }}:/books:rw"
|
||||
- "{{ calibre_comics_directory }}:/comics:rw"
|
||||
env:
|
||||
TZ: "{{ ansible_nas_timezone }}"
|
||||
PUID: "{{ calibre_user_id }}"
|
||||
PGID: "{{ calibre_group_id }}"
|
||||
DOCKER_MODS: "{{ calibre_ebook_conversion }}"
|
||||
PASSWORD: "{{ calibre_password }}"
|
||||
CLI_ARGS: "{{ calibre_cli_args }}"
|
||||
ports:
|
||||
- "{{ calibre_port }}:8083"
|
||||
- "{{ calibre_port }}:8080"
|
||||
- "{{ calibre_webserver_port }}:8081"
|
||||
security_opts: "{{ calibre_security_opts }}"
|
||||
restart_policy: unless-stopped
|
||||
memory: "{{ calibre_memory }}"
|
||||
labels:
|
||||
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.domains[0].main: "{{ 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
|
||||
|
||||
- name: Stop Calibre
|
||||
- name: Stop Calibre Manager
|
||||
block:
|
||||
- name: Stop Calibre
|
||||
- name: Stop Calibre Manager
|
||||
docker_container:
|
||||
name: "{{ calibre_container_name }}"
|
||||
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:
|
||||
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
|
||||
vars:
|
||||
calibremanager_enabled: false
|
||||
calibreweb_enabled: false
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
- name: Get container state
|
||||
docker_container_info:
|
||||
name: "{{ calibremanager_container_name }}"
|
||||
name: "{{ calibreweb_container_name }}"
|
||||
register: result
|
||||
|
||||
- name: Check Calibre is running
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
- name: Try and stop and remove Calibre
|
||||
docker_container:
|
||||
name: "{{ calibremanager_container_name }}"
|
||||
name: "{{ calibreweb_container_name }}"
|
||||
state: absent
|
||||
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 @@
|
|||
---
|
||||
title: "Calibre-web"
|
||||
---
|
||||
# Calibre
|
||||
|
||||
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
|
||||
|
||||
|
@ -12,18 +10,15 @@ Set `calibre_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).
|
||||
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.
|
||||
|
||||
- Conversion enabled: `calibre_ebook_conversion: "linuxserver/calibre-web:calibre"`
|
||||
|
||||
- Conversion disabled: `calibre_ebook_conversion: ""`
|
||||
|
||||
You can target just Calibre by appending `-t calibre` to your `ansible-playbook` command.
|
||||
```yml
|
||||
calibre_port: "8093"
|
||||
calibre_webserver_port: "8094"
|
||||
```
|
||||
|
|
|
@ -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