Files
Apps-Community/apps/dockergc.yml
2019-02-28 18:10:06 -07:00

65 lines
2.0 KiB
Bash

#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705
# URL: https://pgblitz.com - http://github.pgblitz.com
# GNU: General Public License v3.0
################################################################################
---
- hosts: localhost
gather_facts: false
tasks:
# FACTS #######################################################################
- name: 'Set Known Facts'
set_fact:
pgrole: 'dockergc'
intport: '1'
extport: '1'
image: 'clockworksoul/docker-gc-cron'
# CORE (MANDATORY) ############################################################
- name: 'Including cron job'
include_tasks: '/opt/communityapps/apps/_core.yml'
# MANDATORY DOCKERGC ##########################################################
- name: Install docker-gc-exclude
template:
src: /opt/communityapps/apps/templates/docker-gc-exclude
dest: /opt/appdata/{{pgrole}}/docker-gc-exclude
force: yes
mode: 0775
owner: '1000'
group: '1000'
# LABELS ######################################################################
- name: 'Setting PG Volumes'
set_fact:
pg_volumes:
- /opt/appdata/dockergc/docker-gc-exclude:/etc/docker-gc-exclude
- /var/run/docker.sock:/var/run/docker.sock
- /etc/localtime:/etc/localtime:ro
- name: 'Setting PG ENV'
set_fact:
pg_env:
PUID: '1000'
PGID: '1000'
CLEAN_UP_VOLUMES: 1
# MAIN DEPLOYMENT #############################################################
- name: 'Deploying {{pgrole}}'
docker_container:
name: '{{pgrole}}'
image: '{{image}}'
pull: yes
volumes: '{{pg_volumes}}'
env: '{{pg_env}}'
restart_policy: unless-stopped
networks:
- name: plexguide
aliases:
- '{{pgrole}}'
state: started
labels:
traefik.enabled: 'false'