main.yml 1 KB
Newer Older
1
2
3
4
5
6
7
8
9
---

- name: install prometheus,alertmanager server
  pacman: name=prometheus,alertmanager state=present

- name: install prometheus configuration
  template: src=prometheus.yml.j2 dest=/etc/prometheus/prometheus.yml owner=root group=root mode=644
  notify: reload prometheus

10
11
12
13
- name: install prometheus cli configuration
  copy: src=prometheus.conf dest=/etc/conf.d/prometheus owner=root group=root mode=600
  notify: reload prometheus

14
15
16
17
18
- name: install prometheus alert configuration
  copy: src=node.rules.yml dest=/etc/prometheus/node.rules.yml owner=root group=root mode=644
  notify: reload prometheus

- name: install alertmanager configuration
19
  template: src=alertmanager.yml.j2 dest=/etc/alertmanager/alertmanager.yml owner=root group=alertmanager mode=640
20
21
22
23
24
25
26
  notify: reload alertmanager

- name: enable prometheus server service
  systemd: name=prometheus enabled=yes daemon_reload=yes state=started

- name: enable alertmanager server service
  systemd: name=alertmanager enabled=yes daemon_reload=yes state=started