-
Notifications
You must be signed in to change notification settings - Fork 5
/
mattermost.yml
120 lines (105 loc) · 4.48 KB
/
mattermost.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
120
---
- hosts: homelab
vars:
application: mattermost
docker_network: "{{ networks.pub }}"
handlers:
- name: Restart
community.docker.docker_container:
name: "{{ application }}"
restart: true
comparisons:
'*': ignore
tasks:
- name: Create config directory
ansible.builtin.file:
path: "{{ config_directory }}"
state: directory
owner: "{{ common_user_id }}"
group: "{{ common_root_group }}"
mode: "0771"
- name: Create postgres container
ansible.builtin.include_role:
name: postgres
vars:
postgres_version: 16
postgres_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
66636138626433383439313439353435373036616161646536333333363464383163336361613931
3361653330393532623865393836336434363162663635330a323366346464326634373038366630
38323236366237633331306434366464666564376337623930386163323466623538393037333131
6234393131386537310a346562323563663637393763653961376137613538316638653165363637
38646136363563656132303534333630343136363536343666663230633466333736
- name: Create app directories
ansible.builtin.file:
path: "{{ config_directory }}/config/{{ item }}"
state: directory
recurse: true
owner: "2000"
group: "2000"
loop:
- config
- data
- logs
- plugins
- bleveindexes
- client-plugins
- name: Create container
ansible.builtin.include_role:
name: docker_container
vars:
image: mattermost/mattermost-team-edition:10.3.1
volumes:
- "{{ config_directory }}/config/config:/mattermost/config"
- "{{ config_directory }}/config/data:/mattermost/data"
- "{{ config_directory }}/config/logs:/mattermost/logs"
- "{{ config_directory }}/config/plugins:/mattermost/plugins"
- "{{ config_directory }}/config/bleveindexes:/mattermost/bleveindexes"
- "{{ config_directory }}/config/client-plugins:/mattermost/client/plugins"
- /etc/localtime:/etc/localtime:ro
env:
TZ: "{{ common_timezone }}"
traefik:
- port: 8065
homepage:
group: Collaboration
weight: 500
description: "Online chat"
blackbox:
path: /api/v4/system/ping
- name: Configure
json_patch: # noqa fqcn[action]
src: "{{ config_directory }}/config/config/config.json"
pretty: true
operations:
- op: add
path: "{{ item.key }}"
value: "{{ item.value }}"
loop: "{{ _mattermost_configuration | dict2items }}"
notify: Restart
vars:
_mattermost_configuration:
# https://docs.mattermost.com/configure/environment-configuration-settings.html#site-url
ServiceSettings/SiteURL: "https://{{ application }}.{{ common_tld }}"
# https://docs.mattermost.com/configure/environment-configuration-settings.html#web-server-listen-address
ServiceSettings/ListenAddress: ":8065"
# https://docs.mattermost.com/configure/experimental-configuration-settings.html#enable-local-mode-for-mmctl
ServiceSettings/EnableLocalMode: true
# https://docs.mattermost.com/configure/environment-configuration-settings.html#database
SqlSettings/DriverName: postgres
SqlSettings/DataSource: "{{ _postgres_url }}?sslmode=disable\u0026connect_timeout=10"
# https://docs.mattermost.com/configure/environment-configuration-settings.html#console-log-level
LogSettings/ConsoleLevel: "INFO"
# https://docs.mattermost.com/configure/environment-configuration-settings.html#smtp
# https://docs.mattermost.com/configure/smtp-email.html#gmail
EmailSettings/SMTPServer: "{{ common_email_server }}"
EmailSettings/SMTPPort: "{{ common_email_port | string }}"
EmailSettings/ConnectionSecurity: "STARTTLS"
EmailSettings/EnableSMTPAuth: true
EmailSettings/SMTPUsername: "{{ common_email_username }}"
EmailSettings/SMTPPassword: "{{ common_email_password }}"
# https://docs.mattermost.com/configure/experimental-configuration-settings.html#experimental-bleve-configuration-settings
BleveSettings/EnableIndexing: true
BleveSettings/IndexDir: "/mattermost/bleveindexes"
BleveSettings/EnableSearching: true
BleveSettings/EnableAutocomplete: true