forked from bitlair/ansible
Add monitoring role
This commit is contained in:
parent
dca17d5750
commit
d06406c9f4
17 changed files with 539 additions and 0 deletions
27
roles/monitoring/tasks/prometheus.yaml
Normal file
27
roles/monitoring/tasks/prometheus.yaml
Normal file
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
- name: Install dependencies
|
||||
apt:
|
||||
name: prometheus
|
||||
|
||||
- name: Configure Prometheus
|
||||
template:
|
||||
src: prometheus.yml
|
||||
dest: "{{ prometheus_config_dir }}/prometheus.yml"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart prometheus
|
||||
|
||||
- name: Configure Prometheus args
|
||||
lineinfile:
|
||||
path: /etc/default/prometheus
|
||||
line: >-
|
||||
ARGS="
|
||||
--storage.tsdb.retention.time={{ prometheus_storage_retention }}
|
||||
--storage.tsdb.retention.size=0
|
||||
--web.listen-address={{ prometheus_web_listen_address }}
|
||||
--web.external-url=prometheus
|
||||
--config.file={{ prometheus_config_dir }}/prometheus.yml
|
||||
"
|
||||
regexp: '^ARGS'
|
||||
notify: restart prometheus
|
Loading…
Add table
Add a link
Reference in a new issue