-
Notifications
You must be signed in to change notification settings - Fork 5
/
privatebin.yml
73 lines (64 loc) · 2.16 KB
/
privatebin.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
66
67
68
69
70
71
72
73
---
- hosts: homelab
vars:
application: privatebin
docker_network: "{{ networks.pub }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config folders
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
mode: "0700"
owner: nobody
group: "82" # nobody in alpine
- name: Create folders
ansible.builtin.file:
path: "{{ config_directory }}/{{ item }}"
state: directory
mode: "0700"
owner: nobody
group: "82" # nobody in alpine
loop:
- cfg
- data
- name: Set URL shortener value
ansible.builtin.set_fact:
_url_shortener_value: "https://s.{{ common_tld }}/api/v2/action/shorten?key={{ _url_shortener_api_key }}&response_type=json&url="
vars:
_url_shortener_api_key: !vault |
$ANSIBLE_VAULT;1.1;AES256
38656636313235376564646266386163626439346430333036656439643463613037626132646161
6233306532656665393765303531363137636136383064390a303237386363623264306135326435
64623330656534353037613862386530323336323236356539353935313063346338626132363164
3230396331646637360a646536313332353638663766633866376633396465356533636632333231
62353464613531643431333665323631386530376365393332663131663032343735
- name: Template config
ansible.builtin.template:
src: "{{ files_directory }}/conf.php.j2"
dest: "{{ config_directory }}/cfg/conf.php"
mode: "0644"
owner: nobody
group: "82" # nobody in alpine
notify: Restart
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: privatebin/nginx-fpm-alpine:1.7.5
volumes:
- "{{ config_directory }}/data:/srv/data"
- "{{ config_directory }}/cfg:/srv/cfg"
traefik:
- port: 8080
homepage:
name: PrivateBin
group: Sharing
weight: 790
description: "Zero knowledge pastebin"