mirror of
https://github.com/mtan93/Apps-Community.git
synced 2026-03-08 05:31:59 +00:00
79 lines
2.4 KiB
Bash
79 lines
2.4 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Title: PlexGuide (Reference Title File)
|
|
# Author(s): Admin9705
|
|
# URL: https://plexguide.com - http://github.plexguide.com
|
|
# GNU: General Public License v3.0
|
|
################################################################################
|
|
---
|
|
- hosts: localhost
|
|
gather_facts: false
|
|
tasks:
|
|
# FACTS #######################################################################
|
|
- name: 'Set Known Facts'
|
|
set_fact:
|
|
pgrole: 'nzbthrottle'
|
|
intport: '0'
|
|
extport: '0'
|
|
image: 'daghaian/nzbthrottle'
|
|
|
|
# CORE (MANDATORY) ############################################################
|
|
- name: 'Including cron job'
|
|
include_tasks: '/opt/communityapps/apps/_core.yml'
|
|
|
|
- name: 'Checking {{pgrole}}'s json existance'
|
|
stat:
|
|
path: '/opt/communityapps/apps/templates/{{pgrole}}/config.json'
|
|
register: jsoncheck
|
|
|
|
- name: 'Copying file for {{pgrole}}'
|
|
copy:
|
|
src: '/opt/communityapps/apps/templates/{{pgrole}}/config.json'
|
|
dest: '/opt/appdata/{{pgrole}}/{{pgrole}}/config.json'
|
|
directory_mode: yes
|
|
force: yes
|
|
owner: '1000'
|
|
group: '1000'
|
|
mode: 0755
|
|
when: not jsoncheck.stat.exists
|
|
|
|
# LABELS ######################################################################
|
|
- name: 'Adding Traefik'
|
|
set_fact:
|
|
pg_labels:
|
|
traefik.frontend.auth.forward.address: '{{gauth}}'
|
|
traefik.enable: 'true'
|
|
traefik.port: '{{intport}}'
|
|
|
|
traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}'
|
|
|
|
- name: 'Setting PG Volumes'
|
|
set_fact:
|
|
pg_volumes:
|
|
- '/etc/localtime:/etc/localtime:ro'
|
|
- '/opt/appdata/{{pgrole}}/config.json:/{{pgrole}}/config.json:ro'
|
|
|
|
- name: 'Setting PG ENV'
|
|
set_fact:
|
|
pg_env:
|
|
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: unless-stopped
|
|
networks:
|
|
- name: plexguide
|
|
aliases:
|
|
- '{{pgrole}}'
|
|
state: started
|
|
labels: '{{pg_labels}}'
|