forked from stephenogg/playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
monitoringAgents.yml
109 lines (87 loc) · 2.75 KB
/
monitoringAgents.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
---
- hosts: monitored
roles:
- role: cloudalchemy.node_exporter
become: true
- role: sco.promtail
become: true
vars:
loki_host: "206-12-92-26.cloud.computecanada.ca"
when: ansible_nodename == 'grafana' or ansible_nodename == 'omero-backup'
tasks:
- name: set fact
set_fact:
omero_node: "{{ 'true' if ((ansible_nodename == 'omero') or (ansible_nodename == 'national_omero') or (ansible_nodename == 'omero_training')) else 'false' }}"
- name: Create monitoring htpasswd
become: yes
copy:
content: "{{ secret_monitoring_nginx_htpasswd | default(monitoring_nginx_htpasswd) }}"
dest: /etc/nginx/monitoring.htpasswd
mode: 0644
when: omero_node
- name: Create nginx proxy for prometheus exporters
become: yes
copy:
dest: /etc/nginx/conf.d-nested-includes/proxy-exporters.conf
src: confd-nested-proxy-exporters.conf
mode: 0644
when: omero_node
notify:
- restart nginx
handlers:
- name: restart nginx
become: yes
service:
name: nginx
state: restarted
vars:
# monitoring:monitoring
monitoring_nginx_htpasswd: |
monitoring:$apr1$njrafrtU$19wf/I15zPuSudlM5Y50Z0
- hosts: omero_server
roles:
- role: ome.prometheus_jmx
- role: sco.promtail
become: true
vars:
loki_host: "206-12-92-26.cloud.computecanada.ca"
promtail_config_file: templates/promtail-omero.yml.j2
# For restart handlers
# and {{omero_common_basedir}} (normally /opt/omero)
- role: ome.omero_common
#sco.omero_prometheues_exporter works with Ubuntu20
- role: sco.omero_prometheus_exporter
vars:
omero_prometheus_exporter_omero_user: omero-monitoring
omero_prometheus_exporter_omero_password: omero-monitoring
tasks:
- name: omero-server prometheus jmx agents
become: yes
copy:
dest: "{{ omero_common_basedir }}/server/config/prometheus.omero"
src: omero-server-config-prometheus.omero
mode: 0644
notify:
- restart omero-server
- hosts: omero_web
roles:
- role: ome.omero_web_django_prometheus
tasks:
- name: Create nginx proxy for prometheus web exporters
become: yes
copy:
dest: /etc/nginx/conf.d-nested-includes/proxy-exporters-web.conf
src: confd-nested-proxy-exporters-web.conf
mode: 0644
notify:
- restart nginx
handlers:
- name: restart nginx
become: yes
service:
name: nginx
state: restarted
- hosts: omero_db
roles:
- role: ome.prometheus_postgres
prometheus_postgres_dbname: omero