-
Notifications
You must be signed in to change notification settings - Fork 6
/
emby
83 lines (72 loc) · 2.36 KB
/
emby
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
#!/bin/bash
############# https://github.com/plexguide/PlexGuide.com/graphs/contributors ###
emby () {
container_reset
# VARIABLES ####################################################################
pgrole="emby"
port_inside01="8096"
port_outside01="8096"
traefik_extport="8096"
container_path /pg /pg
container_path /pg/unity /pg/unity
container_path /pg/data/$pgrole /config
container_path /etc/localtime /etc/localtime:ro
container_permissions PUID 1000
container_permissions PGID 1000
container_permissions GIDLIST 1000
# IMAGES EXPORT - 1ST IS DEFAULT ###############################################
cat <<- EOF > "/pg/images/$pgrole.images"
linuxserver/emby:latest
linuxserver/emby:beta
EOF
# YML EXPORT ###################################################################
container_core
cat <<- EOF > "/pg/apps/$pgrole.yml"
$container_header
### ALIGN WITH THE A ################################## START - EXTRAS #########
- name: "/dev/dri Check"
stat:
path: "/dev/dri"
register: dev_dri
- name: 'XML Check - $pgrole'
stat:
path: /pg/data/$pgrole/config/system.xml
register: xmlcheck
####### ALIGN WITH THE A ############################## CORE ###################
$container_start
published_ports:
- '${portcheck_add}${port_outside01}:${port_inside01}'
devices: "{{ '/dev/dri:/dev/dri' if dev_dri.stat.exists == True | default(false) else omit }}"
expose: '8096'
env:
$container_permissions
labels:
$container_traefik
$container_oddball
$container_ending
### ALIGN WITH THE A ################################## END - EXTRAS ###########
- name: 'Configuring $pgrole for first time use'
block:
- name: 'Pending XML Generation'
wait_for:
path: '/pg/data/$pgrole/config/system.xml'
state: present
- name: 'Wait 5 Seconds'
wait_for:
timeout: 5
- name: 'Stop $pgrole'
docker_container:
name: '$pgrole'
state: stopped
- name: 'Turn Off Reporting'
xml:
path: '/pg/data/$pgrole/config/system.xml'
xpath: /ServerConfiguration/EnableAnonymousUsageReporting
value: 'false'
- name: 'Restart $pgrole'
docker_container:
name: '$pgrole'
state: started
when: not xmlcheck.stat.exists
EOF
}