-
Notifications
You must be signed in to change notification settings - Fork 135
/
main.yml
65 lines (60 loc) · 2.15 KB
/
main.yml
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
#########################################################################
# Title: Community: pyLoad #
# Author(s): Tr4il #
# URL: https://github.com/Cloudbox/Community #
# Docker Image(s): cobraeti/pyload #
# -- #
# Part of the Cloudbox project: https://cloudbox.works #
#########################################################################
# GNU General Public License v3.0 #
#########################################################################
---
- name: "Setting CloudFlare DNS Record"
include_role:
name: cloudflare-dns
vars:
record: pyload
when: cloudflare_enabled
- name: Stop and remove any existing container
docker_container:
name: pyload
state: absent
- name: Create pyload directories
file: "path={{ item }} state=directory mode=0775 owner={{ user.name }} group={{ user.name }}"
with_items:
- /opt/pyload
- name: Create new downloads directories
file: "path={{ item }} state=directory mode=0775 owner={{ user.name }} group={{ user.name }} recurse=yes"
with_items:
- /mnt/local/downloads/pyload
- name: Set default_volumes variable
set_fact:
default_volumes:
- "/etc/timezone:/etc/timezone:ro"
- "/opt/pyload:/config"
- "/opt/scripts:/opt/scripts"
- "/mnt/local/downloads/pyload:/downloads"
- "/mnt:/mnt"
- name: Create and start container
docker_container:
name: pyload
image: cobraeti/pyload
pull: yes
env:
TZ: "{{ tz }}"
PUID: "{{ uid }}"
PGID: "{{ gid }}"
VIRTUAL_HOST: "pyload.{{ user.domain }}"
VIRTUAL_PORT: "8000"
LETSENCRYPT_HOST: "pyload.{{ user.domain }}"
LETSENCRYPT_EMAIL: "{{ user.email }}"
volumes: "{{ default_volumes }}"
labels:
"com.github.cloudbox.cloudbox_managed": "true"
networks:
- name: cloudbox
aliases:
- pyload
purge_networks: yes
restart_policy: unless-stopped
state: started