You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.3 KiB

---
- name: create folder for nginx exporter configs
file:
path: /etc/nginx/exporter/
state: directory
mode: '0755'
tags: [ setup, monitoring ]
- name: install htpasswd for exporters
import_role:
name: geerlingguy.htpasswd
tags: [ setup, monitoring ]
## node exporter
- name: install node-exporter
import_role:
name: cloudalchemy.node_exporter
tags: [ setup, monitoring, node-exporter ]
- name: copy node-exporter nginx configfile
template:
src: etc/nginx/exporter/node.j2
dest: /etc/nginx/exporter/node.conf
mode: '0644'
tags: [ setup, monitoring, node-exporter ]
## psql exporter
- name: install postgres_exporter on postgres_exporter group
import_role:
name: entercloudsuite.prometheus-exporter
vars:
prometheus_exporter_name: postgres_exporter
url: "{{ psql_exporter_repo_url }}"
prometheus_environment_variables: "{{ psql_environment_variables }}"
prometheus_exporter_config_flags: "{{ psql_exporter_config_flags }}"
tags: [ setup, monitoring, psql-exporter ]
- name: copy psql-exporter nginx configfile
template:
src: etc/nginx/exporter/psql.j2
dest: /etc/nginx/exporter/psql.conf
mode: '0644'
tags: [ setup, monitoring, psql-exporter ]
## statsd
- name: install statsd-exporter
import_role:
name: sorrowless.prometheus_statsd_exporter
tags: [ setup, monitoring, statsd-exporter ]
- name: copy statsd-exporter nginx configfile
template:
src: etc/nginx/exporter/statsd.j2
dest: /etc/nginx/exporter/statsd.conf
mode: '0644'
tags: [ setup, monitoring, statsd-exporter ]
- name: make mastodon send infos to statsd-exporter
blockinfile:
path: /home/{{ mastodon_user }}/live/.env.production
block: |
## statsd-export
STATSD_ADDR= {{ statsd_exporter_listen_udp_adress }}
insertafter: EOF
tags: [ setup, monitoring, statsd ]
notify:
- restart mastodon-sidekiq
- reload mastodon-web
## promtail
- name: install promtail
import_role:
name: patrickjahns.promtail
tags: [ setup, monitoring, promtail ]
- name: include exporter configs in nginx config
lineinfile:
path: /etc/nginx/sites-available/mastodon.conf
line: ' include /etc/nginx/exporter/*.conf;'
insertbefore: '^\s*error_page'
regexp: '^\s*include\s\/etc\/nginx\/exporter'
tags: [ setup, monitoring ]