You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
661 B
YAML
27 lines
661 B
YAML
5 years ago
|
---
|
||
|
- name: Install Prometheus
|
||
|
apt:
|
||
|
update_cache: true
|
||
|
name: prometheus
|
||
|
register: apt_result
|
||
|
retries: 3
|
||
|
until: apt_result is succeeded
|
||
|
|
||
|
- name: Configure Prometheus
|
||
|
template:
|
||
|
src: prometheus/prometheus.yml.j2
|
||
|
dest: /etc/prometheus/prometheus.yml
|
||
|
notify: Restart Prometheus
|
||
|
|
||
|
- name: Configure Prometheus alert rules
|
||
|
template:
|
||
|
src: prometheus/alert.rules.yml.j2
|
||
|
dest: /etc/prometheus/alert.rules.yml
|
||
|
notify: Restart Prometheus
|
||
|
|
||
|
# We don't need to restart Prometheus when updating nodes
|
||
|
- name: Configure Prometheus nodes
|
||
|
copy:
|
||
|
content: "{{ prometheus_targets | to_nice_json }}"
|
||
|
dest: /etc/prometheus/targets.json
|