forked from calvinbui/ansible-monorepo
/
guacamole.yml
82 lines (73 loc) · 2.66 KB
/
guacamole.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
---
- hosts: homelab
vars:
application: guacamole
docker_network: "{{ networks.user }}"
tasks:
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 600
changed_when: false
- name: Create config folder
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user }}"
group: "{{ common_group }}"
mode: "0771"
- name: Copy SQL database init script
ansible.builtin.copy:
src: "{{ files_directory }}/initdb.sql"
dest: "{{ config_directory }}/initdb.sql"
mode: "0444"
- name: Create postgres container
ansible.builtin.include_role:
name: postgres
vars:
postgres_version: 15
postgres_directory_extra:
- "{{ config_directory }}/initdb.sql:/docker-entrypoint-initdb.d/initdb.sql:ro"
postgres_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
30336234666131353835373535303330653030343362616236613238323738333139393264376537
6432333034306266303937623965396261633734323437300a356662623666346363623565363431
38613263636132383361323763363939363531356566636138323463376239323238343863373930
3430326538393062370a353631663063333532396530326264333763383233373664383538666665
30323233326666313636313831393065623339356633613535313961333131323033653933336639
3031393834336639313964353266363665366634646235346539
- name: Create guacd container
ansible.builtin.include_role:
name: docker_container
vars:
name: "{{ application }}-guacd"
image: guacamole/guacd:1.5.3
env:
GUACD_LOG_LEVEL: debug
- name: Create guacamole container
ansible.builtin.include_role:
name: docker_container
vars:
image: guacamole/guacamole:1.5.3
volumes:
- "{{ config_directory }}/{{ application }}:/config"
env:
GUACD_HOSTNAME: "{{ application }}-guacd.{{ docker_network.name }}"
GUACD_LOG_LEVEL: debug
POSTGRES_HOSTNAME: "{{ _postgres_hostname }}"
POSTGRES_DATABASE: "{{ _postgres_database }}"
POSTGRES_USER: "{{ _postgres_username }}"
POSTGRES_PASSWORD: "{{ _postgres_password }}"
traefik:
- port: 8080
middlewares:
- "{{ application }}-addprefix"
homepage:
name: Guacamole
group: Remote Access
weight: 100
description: "Remote access"
labels:
'{
"traefik.http.middlewares.{{ application }}-addprefix.addprefix.prefix": "/guacamole"
}'