2019-05-05 14:07:04 +02:00
|
|
|
---
|
|
|
|
- name: Install Prometheus node-exporter
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name: prometheus-node-exporter
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2019-05-05 16:17:52 +02:00
|
|
|
|
2019-07-22 20:56:43 +02:00
|
|
|
- name: Activate prometheus-node-exporter service
|
|
|
|
systemd:
|
|
|
|
name: prometheus-node-exporter
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
|
2019-05-05 16:24:04 +02:00
|
|
|
# Doesn't work on Debian Stretch
|
2019-05-05 16:17:52 +02:00
|
|
|
- name: Make Prometheus node-exporter listen on adm only
|
2019-05-05 16:24:04 +02:00
|
|
|
when:
|
2019-07-22 20:56:43 +02:00
|
|
|
- ansible_lsb.codename == 'buster'
|
2019-05-05 16:17:52 +02:00
|
|
|
lineinfile:
|
|
|
|
path: /etc/default/prometheus-node-exporter
|
|
|
|
regexp: '^ARGS='
|
2019-07-22 20:56:43 +02:00
|
|
|
line: "ARGS=\"--web.listen-address={{ ansible_hostname }}.adm.auro.re:9100\""
|
2019-05-05 16:17:52 +02:00
|
|
|
notify: Restart prometheus-node-exporter
|