mirror of
https://github.com/mtan93/Apps-Community.git
synced 2026-03-08 05:31:59 +00:00
Delete plexsynctest.yml
This commit is contained in:
@@ -1,120 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Title: Plex Database Sync for PlexGuide Community
|
||||
# Author(s): timekills
|
||||
# URL: https://plexguide.com - https://github.com/timekills
|
||||
# GNU: General Public License v3.0
|
||||
#
|
||||
# Sync will execute every day at 0400 local. Can be changed in line 61 by modifying the CRON settings:
|
||||
# See: https://tecadmin.net/crontab-in-linux-with-20-examples-of-cron-schedule/ for CRON examples
|
||||
#
|
||||
# To run manually execute ./cron-script from inside the docker container. e.g.:
|
||||
# 1. From the host type "docker exec -it plexsync /bin/bash" (without the quotes) to enter the docker container.
|
||||
# 2. From inside the docker container typer "./cron-script" (without the quotes) to execute the sync immediately.
|
||||
################################################################################
|
||||
---
|
||||
- hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
# FACTS #######################################################################
|
||||
|
||||
- name: 'Set Known Facts'
|
||||
set_fact:
|
||||
pgrole: 'plexsync'
|
||||
intport: '1700'
|
||||
extport: '1700'
|
||||
image: 'nowsci/plex-db-sync'
|
||||
|
||||
# CORE (MANDATORY) ############################################################
|
||||
- name: 'Including cron job'
|
||||
include_tasks: '/opt/plexguide/containers/_core.yml'
|
||||
|
||||
# LABELS ######################################################################
|
||||
- name: 'Adding Traefik'
|
||||
set_fact:
|
||||
pg_labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.port: '{{intport}}'
|
||||
traefik.frontend.auth.forward.address: '{{gauth}}'
|
||||
traefik.frontend.rule: 'Host:plexsync.{{domain.stdout}},{{tldset}}'
|
||||
|
||||
- name: 'Setting PG Volumes'
|
||||
set_fact:
|
||||
pg_volumes:
|
||||
- '/opt/appdata/{{pgrole}}:/config:rw'
|
||||
- 'S1_SSH_KEY=/sshkey'
|
||||
- '/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/:/mnt/DB2'
|
||||
- '/etc/localtime:/etc/localtime:ro'
|
||||
|
||||
- name: 'Setting PG ENV'
|
||||
set_fact:
|
||||
pg_env:
|
||||
USER_ID: 1000
|
||||
GROUP_ID: 1000
|
||||
KEEP_APP_RUNNING: 1
|
||||
S1_SSH_USER: "root"
|
||||
S1_SSH_HOST: "ssh.timekills.info"
|
||||
S1_SSH_PORT: "22"
|
||||
S1_SSH_PATH: "/opt/appdata/plex/database/Library/Application Support/Plex Media Server/Plug-in Support/Databases/"
|
||||
S1_START: "ssh -oStrictHostKeyChecking=no -i /sshkey root@ssh.timekills.xyz 'cd /; docker start plex'"
|
||||
S1_STOP: "ssh -oStrictHostKeyChecking=no -i /sshkey root@ssh.timekills.xyz 'cd /; docker stop plex'"
|
||||
S2_DB_PATH: "/mnt/DB2"
|
||||
S2_START: "cd /; docker start plex"
|
||||
S2_STOP: "cd /; docker stop plex"
|
||||
BACKUP: "true"
|
||||
DRYRUN: "true"
|
||||
CRON: "0 4 * * *"
|
||||
|
||||
# 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}}'
|
||||
|
||||
- name: 'Wait 7 Seconds'
|
||||
wait_for:
|
||||
timeout: 7
|
||||
|
||||
- name: Stop Container
|
||||
docker_container:
|
||||
name: '{{pgrole}}'
|
||||
state: stopped
|
||||
|
||||
# ENDING FOR PLEXSYNC ###########################################################
|
||||
|
||||
# - name: 'Waiting for {{pgrole}} to initialize'
|
||||
# wait_for:
|
||||
# path: '/opt/appdata/{{pgrole}}/core.conf'
|
||||
# state: present
|
||||
|
||||
- name: 'Configuring {{pgrole}} for first time use'
|
||||
block:
|
||||
- name: 'Stopping {{pgrole}}'
|
||||
docker_container:
|
||||
name: '{{pgrole}}'
|
||||
state: stopped
|
||||
|
||||
# - name: Setting plugins directory
|
||||
# lineinfile:
|
||||
# path: '/opt/appdata/{{pgrole}}/core.conf'
|
||||
# regexp: '"plugins_location"'
|
||||
# line: '"plugins_location": "/config/plugins",'
|
||||
# state: present
|
||||
|
||||
- name: Restart Container
|
||||
docker_container:
|
||||
name: '{{pgrole}}'
|
||||
state: started
|
||||
Reference in New Issue
Block a user