-
Notifications
You must be signed in to change notification settings - Fork 5
/
guacamole.yml
107 lines (93 loc) · 3.57 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
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
---
- hosts: homelab
vars:
application: guacamole
docker_network: "{{ networks.user }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
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: 16
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.5
env:
GUACD_LOG_LEVEL: debug
- name: Create guacamole container
ansible.builtin.include_role:
name: docker_container
vars:
image: guacamole/guacamole:1.5.5
volumes:
- "{{ config_directory }}/{{ application }}:/config"
env:
GUACD_HOSTNAME: "{{ application }}-guacd.{{ docker_network.name }}"
GUACD_LOG_LEVEL: debug
WEBAPP_CONTEXT: "ROOT"
POSTGRESQL_HOSTNAME: "{{ _postgres_hostname }}"
POSTGRESQL_DATABASE: "{{ _postgres_database }}"
POSTGRESQL_USER: "{{ _postgres_username }}"
POSTGRESQL_PASSWORD: "{{ _postgres_password }}"
OPENID_AUTHORIZATION_ENDPOINT: "https://authelia.{{ common_tld }}/api/oidc/authorization?state=1234abcedfdhf"
OPENID_CLIENT_ID: "{{ application }}"
OPENID_ISSUER: "https://authelia.{{ common_tld }}"
OPENID_JWKS_ENDPOINT: "https://authelia.{{ common_tld }}/jwks.json"
OPENID_SCOPE: openid profile email
OPENID_REDIRECT_URI: "https://{{ application }}.{{ common_tld }}"
OPENID_USERNAME_CLAIM_TYPE: preferred_username
OPENID_GROUPS_CLAIM_TYPE: groups
traefik:
- port: 8080
homepage:
group: Remote Access
weight: 100
description: "Remote access"
- name: Link extensions
community.docker.docker_container_exec:
container: "{{ application }}"
command: find /opt/guacamole/{{ item }}/ -name \*.jar -exec ln -vs "{}" . ';'
chdir: /home/guacamole/.guacamole/extensions/
register: _command_result
failed_when: false
changed_when: ('File exists' not in _command_result.stderr)
notify: Restart
loop:
- openid