todo comment
[distro-setup] / a / site.yml
1 ---
2 - hosts: kd.b8.nz
3 roles:
4 - role: prom
5 tags: a
6 prometheus_targets:
7 node:
8 - targets:
9 - "{{ ansible_fqdn }}:9100"
10 prometheus_scrape_configs:
11 - job_name: "prometheus"
12 metrics_path: "{{ prometheus_metrics_path }}"
13 static_configs:
14 - targets:
15 - "{{ ansible_fqdn }}:9090"
16 - job_name: "node"
17 basic_auth:
18 username: prom
19 password_file: /etc/prometheus-pass
20 #scheme: "https"
21 file_sd_configs:
22 - files:
23 - "{{ prometheus_config_dir }}/file_sd/node.yml"
24 # added because of warning in log
25 prometheus_alertmanager_config:
26 - static_configs:
27 - targets:
28 - "{{ ansible_fqdn }}:9093"
29
30
31 - role: node-exporter
32 tags: a
33 # node_exporter_tls_server_config:
34 # cert_file: /etc/node_exporter/fullchain.pem
35 # key_file: /etc/node_exporter/privkey.pem
36 node_exporter_web_listen_address: "127.0.1.1:9100"
37 node_exporter_basic_auth_users:
38 prom: incarnadine.bloodied.maker
39
40 - role: alertmanager
41 alertmanager_smtp:
42 smarthost: 'mx.iankelling.org:587'
43 from: "alerts@iankelling.org"
44 require_tls: false
45 hello: 'defaultnn.b8.nz'
46 alertmanager_route:
47 receiver: defaultreceiver
48 repeat_interval: 7d
49 alertmanager_receivers:
50 - name: defaultreceiver
51 email_configs:
52 - to: alerts@iankelling.org
53 send_resolved: true
54 # the html was a bit ugly and just a huge waste of text,
55 # https://github.com/prometheus/alertmanager/issues/2232
56 # lead me to find a convenient text option to use
57 html:
58 text: '{% raw -%}{{ template "opsgenie.default.description" . }}{% endraw -%}'
59 alertmanager_web_listen_address: '127.0.1.1:9093'
60
61 - role: grafana
62 grafana_address: "127.0.1.1"
63 # iank: playbook will halt if no password is set. this is only
64 # available to localhost, so i dont really care, but might as well
65 # generate a pass isntead of putting in pw123 etc.
66 grafana_security: { admin_user: admin, admin_password: spheroid.recantation.shank }
67 grafana_datasources:
68 - name: prometheus
69 type: prometheus
70 access: proxy
71 url: 'http://{{ prometheus_web_listen_address }}'
72 basicAuth: false
73 isDefault: true
74 # This is based on looking at highly downloaded dashboards here
75 # https://grafana.com/dashboards?dataSource=prometheus&collector=nodeExporter
76 # Which is where you are lead to from
77 # https://prometheus.io/docs/visualization/grafana/
78 grafana_dashboards:
79 - dashboard_id: 1860
80 revision_id: 21
81 datasource: prometheus
82 - dashboard_id: 405
83 revision_id: 8
84 datasource: prometheus