prometheus/tasks/node_exporter.yml

41 lines
1.4 KiB
YAML
Raw Normal View History

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
when: prometheus_node_exporter_enable == "true"
- name: 'prometheus | node exporter | unarchive'
unarchive:
remote_src: yes
src: /tmp/node_exporter-{{ prometheus_node_exporter_version }}.linux-amd64.tar.gz
dest: /tmp
when: prometheus_node_exporter_enable == "true"
- 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
when: prometheus_node_exporter_enable == "true"
- name: 'prometheus | node exporter | install unit file to systemd'
template:
2021-05-25 18:25:22 +02:00
src: systemd/prometheus-node-exporter.service.j2
dest: /etc/systemd/system/prometheus-node-exporter.service
2021-04-29 18:53:56 +02:00
owner: root
group: root
mode: 0600
when: prometheus_node_exporter_enable == "true"
- name: 'prometheus | node exporter | configure systemd to use service'
systemd:
daemon_reload: yes
enabled: yes
state: started
2021-05-25 18:25:22 +02:00
name: prometheus-node-exporter.service
2021-04-29 18:53:56 +02:00
when: prometheus_node_exporter_enable == "true"