templier-ansible/roles/prometheus-node-exporter/tasks/main.yml
Emmy D'Anello 7f4f846408
Lot of stuff
Signed-off-by: Emmy D'Anello <ynerant@crans.org>
2023-01-12 12:36:32 +01:00

33 lines
868 B
YAML

---
- name: Install Prometheus node-exporter
apt:
update_cache: true
name: prometheus-node-exporter
install_recommends: false # Do not install smartmontools
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Install Prometheus node-exporter-collectors
apt:
update_cache: true
name: prometheus-node-exporter-collectors
install_recommends: false
register: apt_result
retries: 3
until: apt_result is succeeded
- name: Make Prometheus node-exporter listen on adm only
lineinfile:
path: /etc/default/prometheus-node-exporter
regexp: '^ARGS='
line: |
ARGS="--web.listen-address={{ prometheus_node_exporter.listen_addr }}:9100"
tags: restart-node-exporter
- name: Activate prometheus-node-exporter service
systemd:
name: prometheus-node-exporter
enabled: true
state: started