dnsservice/ansible/tasks/prometheus.yml

24 lines
687 B
YAML
Raw Permalink Normal View History

2024-08-03 19:05:31 +00:00
# vi: ft=yaml.ansible
- name: install prometheus
apt:
name: prometheus
- name: install prometheus node exporter
apt:
name: prometheus-node-exporter
- name: copy prometheus config
template:
src: "{{ playbook_dir }}/files/prometheus.yml"
dest: "/etc/prometheus/prometheus.yml"
notify: "reload prometheus"
- name: set prometheus args
copy:
dest: /etc/default/prometheus
content: |
ARGS="--storage.tsdb.retention.time=2d"
notify: "restart prometheus"
- name: ensure prometheus is running
service: name=prometheus state=started enabled=yes
- name: ensure node-exporter is running
service: name=prometheus-node-exporter state=started enabled=yes