-
Notifications
You must be signed in to change notification settings - Fork 5
/
gluetun.yml
119 lines (105 loc) · 4.28 KB
/
gluetun.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
- hosts: homelab
vars:
application: gluetun
docker_network: "{{ networks.pub }}"
gluetun_servers:
-
provider: privado
country: australia
city: sydney
user: &privado_user !vault |
$ANSIBLE_VAULT;1.1;AES256
36616137646432666331386331643365366437643236353136326638643165373837353932303232
3663636231336361633930383937623135633565363563390a396165343063613031383730653737
64636337663139376134663239626365343263646238663365646166623265643232353836613530
6639333231383637640a633530666161316333356566656634333034366135366637336530613165
3331
password: &privado_password !vault |
$ANSIBLE_VAULT;1.1;AES256
39383235373239613739663130306639393864303661386538366665613434633233623637656438
6631616135646638656665643864646161386263326661650a396532316333306565336432646537
37323731396630363337366465383864316461363837346239653865356263626630623762346331
6638376265333530370a323630356235313433633838653036393938326437656238613334616463
30396333326135333536616362653935623463616663316565646133373234626664
config: false
-
provider: privado
country: new zealand
city: auckland
user: *privado_user
password: *privado_password
config: false
-
provider: purevpn
country: australia
city: sydney
user: &purevpn_user !vault |
$ANSIBLE_VAULT;1.1;AES256
62346339393763643733393830616139636137393164313733346137633565366434653131663930
6136623161323136396531373438386637663035323265660a333530316334663263646536616335
36363734363761613738626237653635316533313765386462616661356339653734396335633033
6536323665356134380a653764666636306433363463623137633636633236353034623837323066
37316165396464373335626166636238626532326563393264303266366436393632
password: &purevpn_password !vault |
$ANSIBLE_VAULT;1.1;AES256
62393664336230376333623064666433343136356639643465643238333030396233366636376239
6234343761303133336562626164643265306361323337610a363031353463356230396138303964
35353939326231623063363937656637666434663863313134636337336434623561393133643435
6638306234303835350a616339333836376164653434303562313065383633633163646436623361
6434
config: true
-
provider: purevpn
country: australia
city: perth
user: *purevpn_user
password: *purevpn_password
config: true
tasks:
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0771"
- name: Copy config
ansible.builtin.template:
src: "{{ files_directory }}/{{ item.provider }}-{{ item.city }}.ovpn"
dest: "{{ config_directory }}/"
owner: "{{ common_root_id }}"
group: "{{ common_root_group }}"
mode: "0440"
loop: "{{ gluetun_servers }}"
when: item.config is true
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
name: "{{ application }}-{{ item.provider }}-{{ item.city }}"
image: ghcr.io/qdm12/gluetun:v3.39.1
capabilities:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- "{{ config_directory }}:/gluetun"
env:
VPN_SERVICE_PROVIDER: "{{ 'custom' if item.provider == 'purevpn' else item.provider }}"
OPENVPN_USER: "{{ item.user }}"
OPENVPN_PASSWORD: "{{ item.password }}"
SERVER_COUNTRIES: "{{ item.country if not item.config else omit }}"
SERVER_CITIES: "{{ item.city if not item.config else omit }}"
OPENVPN_CUSTOM_CONFIG: "{{ '/gluetun/' + item.provider + '-' + item.city + '.ovpn' if item.config else omit }}"
HTTPPROXY: "on"
HTTPPROXY_STEALTH: "on"
DOT: "off"
BLOCK_MALICIOUS: "off"
BLOCK_SURVEILLANCE: "off"
BLOCK_ADS: "off"
UPDATER_PERIOD: "0"
TZ: "{{ common_timezone }}"
comparisons:
env: strict
loop: "{{ gluetun_servers }}"