2023-04-27 01:05:24 +02:00
|
|
|
---
|
2023-05-11 15:09:52 +02:00
|
|
|
- name: Download/Extract "{{ node_exporter_download_url }}"
|
2023-04-27 01:05:24 +02:00
|
|
|
unarchive:
|
2023-05-11 15:09:52 +02:00
|
|
|
src: "{{ node_exporter_download_url }}"
|
|
|
|
dest: /tmp/
|
|
|
|
remote_src: true
|
|
|
|
mode: 755
|
|
|
|
|
|
|
|
- name: Move node_exporter into path
|
|
|
|
copy:
|
|
|
|
src: "/tmp/node_exporter-{{ node_exporter_version }}.linux-{{ go_arch }}/node_exporter"
|
2023-07-12 00:02:17 +02:00
|
|
|
dest: "{{ node_exporter.bin_path }}"
|
2023-05-11 15:09:52 +02:00
|
|
|
mode: 755
|
|
|
|
remote_src: true
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Create node_exporter user.
|
|
|
|
user:
|
|
|
|
name: node_exporter
|
|
|
|
shell: /sbin/nologin
|
|
|
|
state: present
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Copy the node_exporter systemd unit file.
|
|
|
|
template:
|
|
|
|
src: node_exporter.service.j2
|
|
|
|
dest: /etc/systemd/system/node_exporter.service
|
|
|
|
mode: 0644
|
|
|
|
register: node_exporter_service
|
|
|
|
become: true
|
|
|
|
|