first commit
This commit is contained in:
38
tasks/main.yml
Normal file
38
tasks/main.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
#SPDX-License-Identifier: MIT-0
|
||||
---
|
||||
- name: Downloading node-exporter
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ NE_download_url }}"
|
||||
dest: /tmp
|
||||
mode: 0755
|
||||
remote_src: yes
|
||||
|
||||
- name: Copying the node_exporter bin file
|
||||
ansible.builtin.copy:
|
||||
src: "/tmp/node_exporter-{{ NE_version }}.linux-{{NE_arch }}/node_exporter"
|
||||
dest: "{{ NE_bin_path }}"
|
||||
mode: 0755
|
||||
remote_src: yes
|
||||
|
||||
- name: "Installing node-exporter"
|
||||
ansible.builtin.user:
|
||||
name: "nodeusr"
|
||||
shell: "/bin/false"
|
||||
create_home: false
|
||||
state: present
|
||||
|
||||
- name: I copy the node_exporter.service file
|
||||
ansible.builtin.template:
|
||||
src: node_exporter.service.j2
|
||||
dest: /etc/systemd/system/node_exporter.service
|
||||
mode: 0644
|
||||
|
||||
- name: re-reading the systemd configuration
|
||||
ansible.builtin.systemd_service:
|
||||
daemon_reload: true
|
||||
|
||||
- name: Starting node_exoporter.service
|
||||
ansible.builtin.systemd_service:
|
||||
name: node_exporter.service
|
||||
state: "{{ NE_state }}"
|
||||
enabled: "{{ NE_enabled }}"
|
||||
Reference in New Issue
Block a user