forked from FF-RGB/ansible
Install node_exporter to enable monitoring
This commit is contained in:
parent
dc0c97b29f
commit
b44e9dc450
6
hosts
6
hosts
@ -3,8 +3,4 @@ gw11.regensburg.freifunk.net
|
||||
gw21.regensburg.freifunk.net
|
||||
gw31.regensburg.freifunk.net
|
||||
confluence.regensburg.freifunk.net
|
||||
|
||||
[gw]
|
||||
gw11.regensburg.freifunk.net
|
||||
gw21.regensburg.freifunk.net
|
||||
gw31.regensburg.freifunk.net
|
||||
unms.ffrgb ansible_host=10.90.224.101
|
||||
|
4
roles/node_exporter/defaults/main.yml
Normal file
4
roles/node_exporter/defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
node_exporter_version: 0.16.0
|
||||
node_exporter_url: https://github.com/prometheus/node_exporter/releases/download/v{{ node_exporter_version }}/node_exporter-{{ node_exporter_version }}.linux-amd64.tar.gz
|
1
roles/node_exporter/files/node_exporter
Normal file
1
roles/node_exporter/files/node_exporter
Normal file
@ -0,0 +1 @@
|
||||
OPTIONS=""
|
6
roles/node_exporter/handlers/main.yml
Normal file
6
roles/node_exporter/handlers/main.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Restart node_exporter
|
||||
service: name=node_exporter state=restarted
|
||||
|
||||
- name: Reload systemd
|
||||
command: systemctl daemon-reload
|
19
roles/node_exporter/tasks/main.yml
Normal file
19
roles/node_exporter/tasks/main.yml
Normal file
@ -0,0 +1,19 @@
|
||||
---
|
||||
|
||||
- name: Create user
|
||||
user: name=node_exporter
|
||||
|
||||
- name: Unpack node_exporter
|
||||
unarchive: src="{{ node_exporter_url }}" remote_src=yes dest=/opt/ creates=/opt/node_exporter-{{ node_exporter_version }}.linux-amd64/node_exporter
|
||||
|
||||
- name: Configure node_exporter
|
||||
copy: src=node_exporter dest=/etc/default/node_exporter
|
||||
|
||||
- name: Install systemd unit
|
||||
template: src=node_exporter.service.j2 dest=/lib/systemd/system/node_exporter.service
|
||||
notify:
|
||||
- Reload systemd
|
||||
- Restart node_exporter
|
||||
|
||||
- name: Enable node_exporter
|
||||
service: name=node_exporter enabled=yes
|
10
roles/node_exporter/templates/node_exporter.service.j2
Normal file
10
roles/node_exporter/templates/node_exporter.service.j2
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Node Exporter
|
||||
|
||||
[Service]
|
||||
User=node_exporter
|
||||
EnvironmentFile=/etc/default/node_exporter
|
||||
ExecStart=/opt/node_exporter-{{ node_exporter_version }}.linux-amd64/node_exporter $OPTIONS
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user