diff --git a/.DS_Store b/.DS_Store index f43dce6..5129328 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bea433 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.DS_Store diff --git a/apps/delugevpn.yml b/apps/delugevpn.yml new file mode 100644 index 0000000..1f97117 --- /dev/null +++ b/apps/delugevpn.yml @@ -0,0 +1,289 @@ +#!/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: 'deluge' + intport: '8112' + extport: '8112' + intport2: '58846' + extport2: '58846' + intport3: '58946' + extport3: '58946' + intport4: '8118' + extport4: '8118' + image: 'binhex/arch-delugevpn' + + # CORE (MANDATORY) ############################################################ + - name: 'Including cron job' + include_tasks: '/opt/plexguide/containers/_core.yml' + + - name: 'Checking for existing app data' + stat: + path: /opt/appdata/{{pgrole}}/core.conf + register: confcheck + + # 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: + - '/opt/appdata/{{pgrole}}:/config' + - '{{path.stdout}}:{{path.stdout}}' + - '/etc/localtime:/etc/localtime:ro' + - '/mnt:/mnt' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + PUID: 1000 + PGID: 1000 + VPN_ENABLED: yes + VPN_USER: vpnuser + VPN_PASS: vpnpass + VPN_PROV: custom + ENABLE_PRIVOXY: no + STRICT_PORT_FORWARD: no + LAN_NETWORK: 192.168.1.1/24 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Deploying {{pgrole}}' + docker_container: + name: '{{pgrole}}' + image: '{{image}}' + pull: yes + published_ports: + - '{{ports.stdout}}{{extport}}:{{intport}}' + - '{{ports.stdout}}{{extport2}}:{{intport2}}' + - '{{ports.stdout}}{{extport3}}:{{intport3}}' + - '{{ports.stdout}}{{extport4}}:{{intport4}}' + volumes: '{{pg_volumes}}' + env: '{{pg_env}}' + restart_policy: unless-stopped + networks: + - name: plexguide + aliases: + - '{{pgrole}}' + state: started + labels: '{{pg_labels}}' + + # CONFIGURATION ########################################################### + - name: 'Waiting for {{pgrole}} to initialize' + wait_for: + timeout: 10 + + - name: Stopping {{pgrole}} + docker_container: + name: '{{pgrole}}' + state: stopped + + - name: 'Checking for appdata' + wait_for: + path: '/opt/appdata/{{pgrole}}/core.conf' + state: present + + - name: Setting plugins directory + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"plugins_location".*' + line: '"plugins_location": "/config/plugins",' + state: present + + - name: Set download location + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"download_location".*' + line: '"download_location": "{{path.stdout}}/downloads/{{pgrole}}",' + state: present + when: incomplete.stdout | length == 0 + + - name: Set incomplete path + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"download_location".*' + line: '"download_location": "{{path.stdout}}/incomplete/{{pgrole}}",' + state: present + when: incomplete.stdout | length > 0 + + - name: Setting complete downloads directory + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"move_completed_path".*' + line: '"move_completed_path": "{{path.stdout}}/downloads/{{pgrole}}",' + state: present + when: incomplete.stdout | length > 0 + + - name: Setting torrent file directory + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"torrentfiles_location".*' + line: '"torrentfiles_location": "{{path.stdout}}/torrent",' + state: present + + - name: Setting torrent watch directory + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"autoadd_location".*' + line: '"autoadd_location": "{{path.stdout}}/torrent/watch",' + state: present + + - name: Setting move_completed when incomplete is undefined + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"move_completed".*' + line: '"move_completed": false,' + state: present + when: incomplete.stdout | length == 0 + + - name: Setting move_completed when incomplete is defined + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"move_completed".*' + line: '"move_completed": true,' + state: present + when: incomplete.stdout | length > 0 + + - name: Setting extractor folder + lineinfile: + path: '/opt/appdata/{{pgrole}}/plugins/extractor.conf' + regexp: '"use_name_folder".*' + line: '"use_name_folder": true,' + state: present + + - name: Setting extractor + lineinfile: + path: '/opt/appdata/{{pgrole}}/plugins/extractor.conf' + regexp: '"extract_path".*' + line: '"extract_path": "{{path.stdout}}/downloads/deluge"' + state: present + + - name: set enabled_plugins + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enabled_plugins".*' + line: '"enabled_plugins": ["Extractor", "Label"],' + state: present + + # FIRST TIME CONFIGURATION #################################################### + - name: 'Configuring {{pgrole}} for first time use' + block: + - name: set compact_allocation + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"compact_allocation".*' + line: '"compact_allocation": true,' + state: present + + - name: set stop_seed_ratio + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"stop_seed_ratio"".*' + line: '"stop_seed_ratio": 1.0,' + state: present + + - name: set share_ratio_limit + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"share_ratio_limit".*' + line: '"share_ratio_limit": 1.0,' + state: present + + - name: set remove_seed_at_ratio + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"remove_seed_at_ratio".*' + line: '"remove_seed_at_ratio": true,' + state: present + + - name: set enc_prefer_rc4 + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enc_prefer_rc4".*' + line: '"enc_prefer_rc4": true,' + state: present + + - name: set enc_level + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enc_level".*' + line: '"enc_level": 1,' + state: present + + - name: set enc_in_policy + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enc_in_policy".*' + line: '"enc_in_policy": 1,' + state: present + + - name: set enc_out_policy + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enc_out_policy".*' + line: '"enc_out_policy": 1,' + state: present + + - name: set max_active_downloading + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"max_active_downloading".*' + line: '"max_active_downloading": 4,' + state: present + + - name: set dont_count_slow_torrents + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"dont_count_slow_torrents".*' + line: '"dont_count_slow_torrents": true,' + state: present + + - name: set max_active_seeding + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"enabled_plugins".*' + line: '"max_active_seeding": 8,' + state: present + + - name: set share_ratio_limit + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"share_ratio_limit".*' + line: '"share_ratio_limit": 1,' + state: present + + - name: set stop_seed_at_ratio + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"stop_seed_at_ratio".*' + line: '"stop_seed_at_ratio": 1.0,' + state: present + + - name: set seed_time_ratio_limit + lineinfile: + path: '/opt/appdata/{{pgrole}}/core.conf' + regexp: '"seed_time_ratio_limit".*' + line: '"seed_time_ratio_limit": 1.0,' + state: present + + #when: not confcheck.stat.exists + + - name: Restart {{pgrole}} + docker_container: + name: '{{pgrole}}' + state: started diff --git a/apps/handbrake-password b/apps/handbrake-password new file mode 100644 index 0000000..6632b0f --- /dev/null +++ b/apps/handbrake-password @@ -0,0 +1,139 @@ +#!/bin/bash +# +# Title: Handbrake for PlexGuide +# Author(s): timekills +# URL: https://plexguide.com - https://github.com/timekills +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'handbrake' + intport: '5800' + extport: '5800' + image: 'jlesage/handbrake:dev-latest' + + # 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: 'Get home variable' + debug: homestorage=ansible_env.HOME + + # LABELS ###################################################################### + - name: 'Adding Traefik' + set_fact: + pg_labels: + traefik.enable: 'true' + traefik.port: '{{intport}}' + traefik.frontend.auth.basic: "plex:$apr1$tosnCNtX$XKXnDaIiW7f0y1nwmd.KL0" + traefik.frontend.rule: 'Host:{{pgrole}}.{{domain.stdout}},{{tldset}}' + + - name: 'Setting PG Volumes' + set_fact: + pg_volumes: + - '/opt/appdata/{{pgrole}}/config:/config:rw' + - '/:/storage:ro' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt/unionfs:/mnt/unionfs' + - '{{path.stdout}}/{{pgrole}}/watch/Very_Fast_1080p30:/watch:rw' + - '{{path.stdout}}/{{pgrole}}/watch/HQ_1080p30_Surround:/watch2:rw' + - '{{path.stdout}}/{{pgrole}}/watch/1080mkv:/watch3:rw' + - '{{path.stdout}}/{{pgrole}}/complete/:/output:rw' + - '/dev/dri:/dev/dri:rw' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + USER_ID: 1000 + GROUP_ID: 1000 + AUTOMATED_CONVERSION_PRESET: "Very Fast 1080p30" + AUTOMATED_CONVERSION_FORMAT: "mp4" + AUTOMATED_CONVERSION_PRESET_2: "HQ 1080p30 Surround" + AUTOMATED_CONVERSION_FORMAT_2: "mp4" + AUTOMATED_CONVERSION_PRESET_3: "H.264 MKV 1080p30" + AUTOMATED_CONVERSION_FORMAT_3: "mkv" +# SECURE_CONNECTION: 1 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Create watch directory for {{pgrole}}' + file: + path: '{{path.stdout}}/handbrake/watch' + state: directory + owner: 1000 + group: 1000 + mode: 0755 + recurse: yes + + - name: 'Create complete directory for {{pgrole}}' + file: + path: '{{path.stdout}}/handbrake/complete' + state: directory + owner: 1000 + group: 1000 + mode: 0755 + recurse: yes + + - 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 6 Seconds' + wait_for: + timeout: 6 + + - name: Stop Container + docker_container: + name: '{{pgrole}}' + state: stopped + + # ENDING FOR HANDBRAKE ########################################################### + +# - 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 diff --git a/apps/handbrake.yml b/apps/handbrake.yml new file mode 100644 index 0000000..239d61c --- /dev/null +++ b/apps/handbrake.yml @@ -0,0 +1,139 @@ +#!/bin/bash +# +# Title: Handbrake for PlexGuide +# Author(s): timekills +# URL: https://plexguide.com - https://github.com/timekills +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'handbrake' + intport: '5800' + extport: '5800' + image: 'jlesage/handbrake:dev-latest' + + # 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: 'Get home variable' + debug: homestorage=ansible_env.HOME + + # 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:/config:rw' + - '/:/storage:ro' + - '{{path.stdout}}:{{path.stdout}}' + - '/mnt/unionfs:/mnt/unionfs' + - '{{path.stdout}}/{{pgrole}}/watch/Very_Fast_1080p30:/watch:rw' + - '{{path.stdout}}/{{pgrole}}/watch/HQ_1080p30_Surround:/watch2:rw' + - '{{path.stdout}}/{{pgrole}}/watch/1080mkv:/watch3:rw' + - '{{path.stdout}}/{{pgrole}}/complete/:/output:rw' + - '/dev/dri:/dev/dri:rw' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + USER_ID: 1000 + GROUP_ID: 1000 + AUTOMATED_CONVERSION_PRESET: "Very Fast 1080p30" + AUTOMATED_CONVERSION_FORMAT: "mp4" + AUTOMATED_CONVERSION_PRESET_2: "HQ 1080p30 Surround" + AUTOMATED_CONVERSION_FORMAT_2: "mp4" + AUTOMATED_CONVERSION_PRESET_3: "H.264 MKV 1080p30" + AUTOMATED_CONVERSION_FORMAT_3: "mkv" +# SECURE_CONNECTION: 1 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Create watch directory for {{pgrole}}' + file: + path: '{{path.stdout}}/handbrake/watch' + state: directory + owner: 1000 + group: 1000 + mode: 0755 + recurse: yes + + - name: 'Create complete directory for {{pgrole}}' + file: + path: '{{path.stdout}}/handbrake/complete' + state: directory + owner: 1000 + group: 1000 + mode: 0755 + recurse: yes + + - 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 6 Seconds' + wait_for: + timeout: 6 + + - name: Stop Container + docker_container: + name: '{{pgrole}}' + state: stopped + + # ENDING FOR HANDBRAKE ########################################################### + +# - 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 diff --git a/apps/jdownloader2.yml b/apps/jdownloader2.yml new file mode 100644 index 0000000..baa8db6 --- /dev/null +++ b/apps/jdownloader2.yml @@ -0,0 +1,144 @@ +#!/bin/bash +# +# Title: Jdownloader2 for PlexGuide (OAuth security) +# Author(s): timekills +# URL: https://plexguide.com - https://github.com/timekills/jdownloader2-for-Plexguide +# GNU: General Public License v3.0 +################################################################################ +--- +- hosts: localhost + gather_facts: false + tasks: + # FACTS ####################################################################### + + - name: 'Set Known Facts' + set_fact: + pgrole: 'jdownloader2' + intport: '5800' + extport: '5800' + intport2: '5902' + extport2: '5902' + intport3: '3129' + extport3: '3129' + image: 'jlesage/jdownloader-2' + + # 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}}/incomplete/{{pgrole}}' + + - name: 'Chown download folder' + shell: 'chown -R 1000:1000 {{path.stdout}}/incomplete/{{pgrole}}/' + + - name: 'Chmod download folder' + shell: 'chmod -R 775 {{path.stdout}}/incomplete/{{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}}/incomplete/{{pgrole}}/:/output:rw' + - '/etc/localtime:/etc/localtime:ro' + + - name: 'Setting PG ENV' + set_fact: + pg_env: + UID: 1000 + GID: 1000 + + # MAIN DEPLOYMENT ############################################################# + - name: 'Create scripts directory for {{pgrole}}' + file: + path: /opt/appdata/{{pgrole}}/scripts + state: directory + owner: 1000 + group: 1000 + mode: 0755 + +# - name: 'Create plugins directory for {{pgrole}}' +# file: +# path: /opt/appdata/{{pgrole}}/plugins +# state: directory +# owner: 1000 +# group: 1000 +# mode: 0755 + + - 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 6 Seconds' + wait_for: + timeout: 6 + + - 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: 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 + + when: not inicheck.stat.exists diff --git a/apps/radarr4k.yml b/apps/radarr4k.yml index a2a1d19..bc40655 100644 --- a/apps/radarr4k.yml +++ b/apps/radarr4k.yml @@ -41,7 +41,7 @@ - name: 'Copy scripts into directory for {{pgrole}}' copy: - src: ./templates/cleanup-radarr.sh + src: /opt/plexguide/containers/templates/radarr/scripts/cleanup-radarr.sh dest: /opt/appdata/{{pgrole}}/scripts directory_mode: yes force: yes diff --git a/apps/sonarr4k.yml b/apps/sonarr4k.yml index 987bca6..a6141e5 100644 --- a/apps/sonarr4k.yml +++ b/apps/sonarr4k.yml @@ -41,7 +41,7 @@ - name: 'Copy scripts into directory for {{pgrole}}' copy: - src: ./templates/cleanup-sonarr.sh + src: /opt/plexguide/containers/templates/sonarr/scripts/cleanup-sonarr.sh dest: /opt/appdata/{{pgrole}}/scripts directory_mode: yes force: yes diff --git a/apps/xteve.yml b/apps/xteve.yml deleted file mode 100644 index 94e3745..0000000 --- a/apps/xteve.yml +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -# -# Title: PlexGuide (Reference Title File) -# Author(s): TechButton -# 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: 'xteve' - intport: '32768' - extport: '34400' - image: 'crobibero/xteve' - - # 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:{{pgrole}}.{{domain.stdout}},{{tldset}}' - - - name: 'Setting PG Volumes' - set_fact: - pg_volumes: - - '/opt/appdata/{{pgrole}}:/home/xteve/xteve' - - '/opt/appdata/{{pgrole}}/temp:/temp/xteve' - - '{{path.stdout}}:{{path.stdout}}' - - '/etc/localtime:/etc/localtime:ro' - - '/mnt:/mnt' - - - 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}}'