Files
Apps-Community/apps/calibre-web.yml
MrDoobPG ea45234ef6 Create calibre-web.yml
created by Sejrup
2019-05-17 16:39:37 +02:00

67 lines
2.1 KiB
Bash

#!/bin/bash
#
# Title: PGBlitz (calibre-web)
# Author(s): Sejrup
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'calibre-web'
intport: '8083'
extport: '8083'
image: 'technosoft2000/calibre-web'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/coreapps/apps/_core.yml'
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
pg_labels:
pg_labels:
traefik.enable: 'true'
traefik.port: '{{intport}}'
traefik.frontend.auth.forward.address: '{{gauth}}'
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
- name: 'Setting PG Volumes'
set_fact:
pg_volumes:
- '/opt/appdata/{{pgrole}}:/books'
- '/opt/appdata/{{pgrole}}/config:/calibre-web/config'
- '/etc/localtime:/etc/localtime:ro'
- name: 'Setting PG ENV'
set_fact:
pg_env:
USE_CONFIG_DIR: 'true'
SET_CONTAINER_TIMEZONE: 'true'
CONTAINER_TIMEZONE: 'Europe/Copenhagen'
PUID: '1000'
PGID: '1000'
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: '{{image}}'
pull: yes
published_ports:
- '{{ports.stdout}}{{extport}}:{{intport}}'
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: always
networks:
- name: plexguide
aliases:
- '{{pgrole}}'
state: started
labels: '{{pg_labels}}'