2021-04-29 18:53:56 +02:00
|
|
|
|
---
|
2021-05-26 12:01:00 +02:00
|
|
|
|
- name: 'prometheus | node exporter | install unit file to systemd'
|
|
|
|
|
template:
|
|
|
|
|
src: systemd/prometheus-node-exporter.service.j2
|
|
|
|
|
dest: /etc/systemd/system/prometheus-node-exporter.service
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
|
|
|
|
mode: 0600
|
|
|
|
|
|
|
|
|
|
- name: 'prometheus | node exporter | configure systemd to use service'
|
|
|
|
|
systemd:
|
|
|
|
|
daemon_reload: yes
|
|
|
|
|
enabled: yes
|
|
|
|
|
name: prometheus-node-exporter.service
|
|
|
|
|
|
2021-04-29 18:53:56 +02:00
|
|
|
|
- name: 'prometheus | node exporter | download'
|
|
|
|
|
get_url:
|
|
|
|
|
url: https://github.com/prometheus/node_exporter/releases/download/v{{ prometheus_node_exporter_version }}/node_exporter-{{ prometheus_node_exporter_version }}.linux-amd64.tar.gz
|
|
|
|
|
dest: /tmp
|
|
|
|
|
|
|
|
|
|
- name: 'prometheus | node exporter | unarchive'
|
|
|
|
|
unarchive:
|
|
|
|
|
remote_src: yes
|
|
|
|
|
src: /tmp/node_exporter-{{ prometheus_node_exporter_version }}.linux-amd64.tar.gz
|
|
|
|
|
dest: /tmp
|
|
|
|
|
|
|
|
|
|
- name: 'prometheus | node exporter | move to /usr/local/bin'
|
|
|
|
|
copy:
|
|
|
|
|
src: /tmp/node_exporter-{{ prometheus_node_exporter_version }}.linux-amd64/node_exporter
|
|
|
|
|
dest: /usr/local/bin/prometheus-node-exporter
|
|
|
|
|
remote_src: yes
|
|
|
|
|
owner: root
|
|
|
|
|
group: root
|
|
|
|
|
mode: 0755
|
2021-05-26 12:01:00 +02:00
|
|
|
|
notify:
|
|
|
|
|
- 'prometheus | node exporter | restart service'
|
2021-04-29 18:53:56 +02:00
|
|
|
|
|