forked from stadtulm/a13-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.yml
More file actions
347 lines (338 loc) · 9.56 KB
/
main.yml
File metadata and controls
347 lines (338 loc) · 9.56 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
---
- name: Basic Setup
hosts: all
become: yes
tags:
- base
vars_files:
- vars.yml
roles:
- base
- name: Base User setup/update
hosts: all
become: yes
tags:
- base
- user
vars_files:
- vars.yml
roles:
- base-user
- name: Monitored host
hosts: all
become: yes
tags:
- monitoring
vars:
_node_exporter_binary_install_dir: '/opt/node_exporter'
_node_exporter_system_group: 'prometheus'
_node_exporter_system_user: 'prometheus'
roles:
- cloudalchemy.node-exporter
- node-exporter-ufw
- cloudalchemy.process_exporter
- process-exporter-ufw
- name: TURN Server
hosts: turn
become: yes
tags:
- turn
vars_files:
- vars.yml
vars:
nginx_ipv4: "{{ turn_ipv4 }}"
nginx_ipv6: "{{ turn_ipv6 }}"
nginx_config_name: "turn"
nginx_domain: "{{ turn_hostname }}"
no_https: true
roles:
- nginx
- turn
- name: BigBlueButton
hosts: bbb
become: yes
tags:
- bbb
vars_files:
- vars.yml
vars:
nginx_ipv4: "{{ web_ipv4 }}"
nginx_ipv6: "{{ web_ipv6 }}"
nginx_config_name: "bbb"
nginx_domain: "{{ inventory_hostname }}"
bbb_hostname: "{{ inventory_hostname }}"
bbb_meteor: {}
roles:
- nginx
- bbb-ori
- name: BBB Exporter
hosts: bbb
become: yes
tags:
- bbb
roles:
- bbb-exporter
- name: Scalelite #BBB-Loadbalancer
hosts: scalelite
become: yes
tags:
- loadbalancer
vars_files:
- vars.yml
vars:
nginx_ipv4: "{{ web_ipv4 }}"
nginx_ipv6: "{{ web_ipv6 }}"
nginx_config_name: "loadbalancer"
nginx_domain: "{{ loadbalancer_hostname }}"
redis_port: 6379
redis_bind_interface: 127.0.0.1
ruby_install_from_source: yes
ruby_version: 2.6.6
ruby_download_url: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.gz
ruby_install_bundler: yes
postgresql_hba_entries:
- {type: local, database: all, user: postgres, auth_method: peer}
- {type: local, database: all, user: all, auth_method: peer}
- {type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5}
- {type: host, database: all, user: all, address: '::1/128', auth_method: md5}
postgresql_users:
- name: scalelite
state: present
password: "{{ scalelite_postgres_password }}"
postgresql_databases:
- name: scalelite
owner: scalelite
state: present
pre_tasks:
# needed for geerlingguy.postgresql
- name: make shure libpq-dev is installed
apt:
name: libpq-dev
update_cache: yes
cache_valid_time: 3600
- name: Make sure psycopg2 is installed
pip:
name: psycopg2
state: present
roles:
- nginx
- geerlingguy.redis
- role: geerlingguy.postgresql
become: yes
- geerlingguy.ruby
- scalelite
- name: Register BBBs at Loadbalancer
hosts: scalelite
become: yes
tags:
- loadbalancer
- config
roles:
- scalelite-config
- name: Frontend - Greenlight
hosts: greenlight
become: yes
vars_files:
- vars.yml
tags:
- frontend
- greenlight
vars:
nginx_ipv4: "{{ web_ipv4 }}"
nginx_ipv6: "{{ web_ipv6 }}"
nginx_config_name: "webui"
nginx_domain: "{{ inventory_hostname }}"
nginx_alias:
- "www.{{ inventory_hostname }}"
lb_url: "{{ scalelite_loadbalancer_url }}"
lb_secret: "{{ scalelite_loadbalancer_secret }}"
redis_port: 6379
redis_bind_interface: 127.0.0.1
ruby_install_from_source: yes
ruby_version: 2.6.6
ruby_download_url: https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.gz
ruby_install_bundler: yes
nodejs_version: "12.x"
postgresql_hba_entries:
- {type: local, database: all, user: postgres, auth_method: peer}
- {type: local, database: all, user: all, auth_method: peer}
- {type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5}
- {type: host, database: all, user: all, address: '::1/128', auth_method: md5}
postgresql_users:
- name: greenlight
state: present
password: "{{ greenlight_postgres_password }}"
role_attr_flags: CREATEDB # rake db:migrate needs priv
postgresql_databases:
- name: greenlight_production
owner: greenlight
state: present
pre_tasks:
# needed for geerlingguy.postgresql
- name: make shure libpq-dev is installed
apt:
name: libpq-dev
update_cache: yes
cache_valid_time: 3600
- name: Make sure psycopg2 is installed
pip:
name: psycopg2
state: present
roles:
- nginx
- geerlingguy.redis
- role: geerlingguy.postgresql
become: yes
- geerlingguy.ruby
- geerlingguy.nodejs
- greenlight
- name: Monitoring
hosts: monitoring
become: yes
tags:
- monitoring
vars_files:
- vars.yml
vars:
nginx_ipv4: "{{ web_ipv4 }}"
nginx_ipv6: "{{ web_ipv6 }}"
nginx_config_name: "monitoring"
nginx_domain: "{{ mon_hostname }}"
prometheus_targets:
node:
- targets:
"{{ groups['all'] | map('extract', hostvars, ['ansible_fqdn']) | map('regex_replace', '$', ':9100') | list }}"
process:
- targets:
"{{ groups['all'] | map('extract', hostvars, ['ansible_fqdn']) | map('regex_replace', '$', ':9256') | list }}"
bbb:
- targets:
"{{ groups['bbb'] | map('extract', hostvars, ['ansible_fqdn']) | map('regex_replace', '$', ':9688') | list }}"
prometheus_scrape_configs:
- job_name: "prometheus"
metrics_path: "/metrics"
static_configs:
- targets:
- "127.0.0.1:9090"
- job_name: "node"
file_sd_configs:
- files:
- "/etc/prometheus/file_sd/node.yml"
relabel_configs:
- source_labels: ['__address__']
separator: ':'
regex: '(.*):.*'
target_label: 'instance'
replacement: '$1'
- job_name: "process"
file_sd_configs:
- files:
- "/etc/prometheus/file_sd/process.yml"
relabel_configs:
- source_labels: [ '__address__' ]
separator: ':'
regex: '(.*):.*'
target_label: 'instance'
replacement: '$1'
- job_name: "bbb"
file_sd_configs:
- files:
- "/etc/prometheus/file_sd/bbb.yml"
relabel_configs:
- source_labels: ['__address__']
separator: ':'
regex: '(.*):.*'
target_label: 'instance'
replacement: '$1'
grafana_address: 127.0.0.1
grafana_port: 3001
grafana_url: "https://{{ mon_hostname }}"
grafana_domain: "{{ mon_hostname }}"
grafana_database:
type: postgres
host: 127.0.0.1:5432
name: grafana
user: grafana
password: "{{ monitoring_grafana_postgres_password }}"
grafana_datasources:
- name: prometheus
type: prometheus
access: proxy
url: 'http://localhost:9090'
basicAuth: false
isDefault: true
grafana_dashboards_dir: files/grafana/dashboards
grafana_security:
admin_user: admin@ori.schuledigital.com
admin_password: '{{ monitoring_grafana_admin_password }}'
grafana_users:
allow_sign_up: false
default_theme: dark
auto_assign_org: true
editors_can_admin: true
auto_assign_org_role: Editor
org_name: ORI
grafana_auth:
disable_login_form: yes
anonymous:
enabled: true
org_name: ORI
org_role: Viewer
generic_oauth:
enabled: true
name: ORI-Cloud
allow_sign_up: true
client_id: "{{ monitoring_client_id }}"
client_secret: "{{ monitoring_client_secret }}"
scopes: user:email,read:org
auth_url: https://ori.schuledigital.com/index.php/apps/oauth2/authorize
token_url: https://ori.schuledigital.com/index.php/apps/oauth2/api/v1/token
api_url: https://ori.schuledigital.com/ocs/v2.php/cloud/user?format=json
email_attribute_path: ocs.data.email
role_attribute_path: contains(ocs.data.groups[*], 'admin') && 'Admin' || 'Viewer'
grafana_smtp:
enabled: true
host: "{{ greenlight_mail.server }}:{{ greenlight_mail.port }}"
user: "{{ greenlight_mail.user }}"
password: "{{ greenlight_mail_password }}"
from_address: "{{ greenlight_mail.sender }}"
startTLS_policy: "MandatoryStartTLS"
grafana_plugins:
- grafana-image-renderer
grafana_unsigned_plugins:
- grafana-image-renderer
postgresql_hba_entries:
- { type: local, database: all, user: postgres, auth_method: peer }
- { type: local, database: all, user: all, auth_method: peer }
- { type: host, database: all, user: all, address: '127.0.0.1/32', auth_method: md5 }
- { type: host, database: all, user: all, address: '::1/128', auth_method: md5 }
postgresql_users:
- name: grafana
state: present
password: "{{ monitoring_grafana_postgres_password }}"
postgresql_databases:
- name: grafana
owner: grafana
state: present
pre_tasks:
# needed for grafana-image-renderer
- name: Install dependencies for grafana-image-renderer
apt:
name:
- libxcomposite1
- libnss3
- libatk-bridge2.0-0
- libgtk-3-0
- libasound2
- libxss1
update_cache: yes
cache_valid_time: 3600
state: present
roles:
- role: geerlingguy.postgresql
become: yes
- cloudalchemy.prometheus
- prometheus-ufw
- cloudalchemy.grafana
- nginx
- grafana