-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakemkv.yml
More file actions
125 lines (106 loc) · 3.64 KB
/
makemkv.yml
File metadata and controls
125 lines (106 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/bash
#
# Title: MakeMKV for PlexGuide
# Author(s): rla999
# URL: https://plexguide.com - https://github.com/rla999/makemkv-for-plexguide/
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'makemkv'
intport: '5800'
extport: '5801'
intport2: '5903'
extport2: '5903'
image: 'jlesage/makemkv'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/plexguide/containers/_core.yml'
# MIGRATIONS (REMOVE SECTION ON MARCH 1st) #############################################################
- name: 'Check for old volumes'
stat:
path: '{{path.stdout}}/{{pgrole}}'
register: oldcheck
- name: 'Migrations'
block:
- name: 'Creating new downloads location'
command: 'mkdir -p {{path.stdout}}/downloads/{{pgrole}}'
- name: 'Chown download folder'
shell: 'chown -R 1000:1000 {{path.stdout}}/downloads/{{pgrole}}/'
- name: 'Chmod download folder'
shell: 'chmod -R 775 {{path.stdout}}/downloads/{{pgrole}}/'
- name: 'Ini Check'
stat:
path: /opt/appdata/{{pgrole}}/core.conf
register: inicheck
# LABELS ######################################################################
- name: 'Adding Traefik'
set_fact:
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}}:/config'
- '{{path.stdout}}:{{path.stdout}}'
- '/mnt/unionfs:/unionfs'
- '{{path.stdout}}/downloads/{{pgrole}}/:/output:rw'
- '/etc/localtime:/etc/localtime:ro'
- name: 'Setting PG ENV'
set_fact:
pg_env:
UID: 1000
GID: 1000
MAKEMKV_KEY: BETA
AUTO_DISC_RIPPER: 0
ENABLE_CJK_FONT: 1
CLEAN_TMP_DIR: 1
KEEP_APP_RUNNING: 1
# 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 JDOWNLOADER2 ###########################################################
# - 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: Restart Container
docker_container:
name: '{{pgrole}}'
state: started
when: not inicheck.stat.exists