mirror of
https://github.com/MHA-Team/PTS-Team.git
synced 2026-02-15 02:32:35 +00:00
84 lines
1.9 KiB
Bash
84 lines
1.9 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Title: Docker Uploader
|
|
# Author(s): MrDoob
|
|
#
|
|
# GNU: General Public License v3.0
|
|
################################################################################
|
|
---
|
|
# RECALL KEY VARIABLES #########################################################
|
|
- name: Register Domain
|
|
shell: 'cat /var/plexguide/server.domain'
|
|
register: domain
|
|
ignore_errors: True
|
|
|
|
- name: Register IP
|
|
shell: 'cat /var/plexguide/server.ip'
|
|
register: ipaddress
|
|
ignore_errors: True
|
|
|
|
- name: Register Ports
|
|
shell: 'cat /var/plexguide/server.ports'
|
|
register: ports
|
|
ignore_errors: True
|
|
|
|
- name: Register HD Path
|
|
shell: 'cat /var/plexguide/server.hd.path'
|
|
register: path
|
|
ignore_errors: True
|
|
|
|
- name: Register Auth Path
|
|
shell: 'cat /var/plexguide/server.ht'
|
|
register: auth
|
|
ignore_errors: True
|
|
|
|
- name: Remove {{pgrole}} Container
|
|
docker_container:
|
|
name: '{{pgrole}}'
|
|
state: absent
|
|
ignore_errors: True
|
|
|
|
- name: Storing Role Name
|
|
shell: "echo '{{pgrole}}' >/tmp/program_var"
|
|
ignore_errors: True
|
|
|
|
# APPDATA
|
|
- name: 'Creating appdata folder if it does not exist.'
|
|
shell: 'mkdir -p /opt/appdata/{{pgrole}}'
|
|
|
|
- name: 'Setting ownership on appdata'
|
|
shell: 'chown 1000:1000 /opt/appdata/{{pgrole}}'
|
|
|
|
- name: 'Script Execute Part I'
|
|
shell: 'bash /opt/plexguide/menu/shield/drop.sh'
|
|
|
|
- name: 'Script Execute Part II'
|
|
shell: 'cat /var/plexguide/auth.var'
|
|
register: oauth
|
|
|
|
- name: 'OAuth Exe'
|
|
block:
|
|
- name: Check if Anti Auth Variable Exists
|
|
stat:
|
|
path: '/var/plexguide/auth/{{pgrole}}'
|
|
register: authcheck
|
|
|
|
- name: 'Auth Check 1'
|
|
set_fact:
|
|
gauth: 'http://oauth:4181'
|
|
when: not authcheck.stat.exists
|
|
|
|
- name: 'Auth Check 2'
|
|
set_fact:
|
|
gauth: ''
|
|
when: authcheck.stat.exists
|
|
|
|
when: oauth.stdout == 'good'
|
|
|
|
- name: 'OAuth Exe'
|
|
set_fact:
|
|
gauth: ''
|
|
when: not oauth.stdout == 'good'
|
|
|
|
- debug: msg="OAuth - {{oauth.stdout}}"
|