2023-04-27 01:05:24 +02:00
|
|
|
---
|
2024-09-19 23:10:00 +02:00
|
|
|
- name: Download/Extract "{{ download_url }}"
|
2024-10-08 11:31:26 +02:00
|
|
|
ansible.builtin.unarchive:
|
2024-09-19 23:10:00 +02:00
|
|
|
src: "{{ download_url }}"
|
2023-05-11 15:09:52 +02:00
|
|
|
dest: /tmp/
|
|
|
|
remote_src: true
|
2024-10-08 11:31:26 +02:00
|
|
|
mode: "755"
|
2023-05-11 15:09:52 +02:00
|
|
|
|
|
|
|
- name: Move node_exporter into path
|
2024-10-08 11:31:26 +02:00
|
|
|
ansible.builtin.copy:
|
2024-10-08 11:17:03 +02:00
|
|
|
src: "/tmp/node_exporter-{{ tag }}.linux-{{ go_arch }}/node_exporter"
|
2024-09-19 23:10:00 +02:00
|
|
|
dest: "{{ bin_path }}"
|
2024-10-08 11:31:26 +02:00
|
|
|
mode: "755"
|
2023-05-11 15:09:52 +02:00
|
|
|
remote_src: true
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Create node_exporter user.
|
2024-10-08 11:31:26 +02:00
|
|
|
ansible.builtin.user:
|
2023-05-11 15:09:52 +02:00
|
|
|
name: node_exporter
|
|
|
|
shell: /sbin/nologin
|
|
|
|
state: present
|
|
|
|
become: true
|
|
|
|
|
|
|
|
- name: Copy the node_exporter systemd unit file.
|
2024-10-08 11:31:26 +02:00
|
|
|
ansible.builtin.template:
|
2023-05-11 15:09:52 +02:00
|
|
|
src: node_exporter.service.j2
|
|
|
|
dest: /etc/systemd/system/node_exporter.service
|
2024-10-08 11:31:26 +02:00
|
|
|
mode: "644"
|
2023-05-11 15:09:52 +02:00
|
|
|
become: true
|