[prometheus-node] Use backports package

certbot_on_virtu
Alexandre Iooss 2019-10-02 08:23:50 +02:00
parent 2273798fad
commit 78643a163d
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
1 changed files with 19 additions and 3 deletions

View File

@ -3,9 +3,26 @@
apt: apt:
update_cache: true update_cache: true
name: prometheus-node-exporter name: prometheus-node-exporter
install_recommends: no # Do not install smartmontools
register: apt_result register: apt_result
retries: 3 retries: 3
until: apt_result is succeeded until: apt_result is succeeded
when:
- ansible_lsb.codename == 'buster'
# Prometheus 2 node is in stretch-backports
- name: Install Prometheus node-exporter (stretch-backports)
apt:
update_cache: true
name: prometheus-node-exporter
install_recommends: no
state: latest
default_release: stretch-backports
register: apt_result
retries: 3
until: apt_result is succeeded
when:
- ansible_lsb.codename == 'stretch'
- name: Activate prometheus-node-exporter service - name: Activate prometheus-node-exporter service
systemd: systemd:
@ -13,12 +30,11 @@
enabled: yes enabled: yes
state: started state: started
# Doesn't work on Debian Stretch # Doesn't work on Debian Stretch with the old prometheus package
- name: Make Prometheus node-exporter listen on adm only - name: Make Prometheus node-exporter listen on adm only
when:
- ansible_lsb.codename == 'buster'
lineinfile: lineinfile:
path: /etc/default/prometheus-node-exporter path: /etc/default/prometheus-node-exporter
regexp: '^ARGS=' regexp: '^ARGS='
line: "ARGS=\"--web.listen-address={{ ansible_hostname }}.adm.crans.org:9100\"" line: "ARGS=\"--web.listen-address={{ ansible_hostname }}.adm.crans.org:9100\""
notify: Restart prometheus-node-exporter notify: Restart prometheus-node-exporter