feat: Create Prometheus Node Exporter user.

This commit is contained in:
William 2022-12-28 13:42:25 +01:00
commit 58c1d948da
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,8 @@
# Install Prometheus Node Exporter
## How to run playbook
```
INVENTORY=vps.example.com,
ansible-playbook -i $INVENTORY -e ansible_python_interpreter=/usr/bin/python3 main.yml
```

21
prometheus-slave/main.yml Normal file
View File

@ -0,0 +1,21 @@
---
- name: Install Prometheus Node Exporter
hosts: all
become: yes
tasks:
- name: Create node-exporter group
group:
name: "node-exporter"
state: present
system: true
- name: Create node-exporter user
user:
name: "node-exporter"
group: "node-exporter"
comment: "Node Exporter"
shell: /bin/false
home: "/usr/local/bin/node-exporter"
system: true
state: present