2019-05-05 14:07:04 +02:00
|
|
|
---
|
|
|
|
- name: Install Prometheus node-exporter
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name: prometheus-node-exporter
|
2019-11-01 14:16:32 +01:00
|
|
|
install_recommends: false # Do not install smartmontools
|
2019-05-05 14:07:04 +02:00
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
2021-03-12 12:28:08 +01:00
|
|
|
when: ansible_lsb.codename == 'buster' or ansible_lsb.codename == 'bullseye'
|
2019-11-01 14:16:32 +01:00
|
|
|
|
|
|
|
# Prometheus 2 node is in stretch-backports
|
|
|
|
- name: Install Prometheus node-exporter (stretch-backports)
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name: prometheus-node-exporter
|
|
|
|
install_recommends: false
|
|
|
|
default_release: stretch-backports
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
when:
|
|
|
|
- ansible_lsb.codename == 'stretch'
|
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
|
2019-07-22 21:04:58 +02:00
|
|
|
enabled: true
|
2019-07-22 20:56:43 +02:00
|
|
|
state: started
|
|
|
|
|
2019-11-01 14:16:32 +01:00
|
|
|
# Doesn't work on Debian Stretch with the old prometheus package
|
2019-05-05 16:17:52 +02:00
|
|
|
- name: Make Prometheus node-exporter listen on adm only
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/default/prometheus-node-exporter
|
|
|
|
regexp: '^ARGS='
|
2019-11-01 14:16:32 +01: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
|