Commit e056f334 authored by Pullyvan Krishnamoorthy's avatar Pullyvan Krishnamoorthy
Browse files

add Centos Support

parent d9e49c4a
---
- name: create the node_exporter account
user:
create_home: false
name: node_exporter
shell: "/bin/false"
- name: Download node_exporter
get_url:
url: https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/repo/epel-7/ibotty-prometheus-exporters-epel-7.repo
dest: /etc/yum.repos.d/_copr_ibotty-prometheus-exporters.repo
- name: Install the 'node_exporter'
yum:
name: "node_exporter"
state: present
- name: deploy the service definition file
template:
dest: /etc/systemd/system/node_exporter.service
src: node_exporter_centos.service
- name: deploy additional service options config file
template:
dest: /etc/nodeexport.conf
src: nodeexport.conf
- name: reload systemd to take the new service into account
systemd:
daemon_reload: yes
enabled: yes
name: node_exporter
state: started
---
- name: create the node_exporter account
user:
create_home: false
name: node_exporter
shell: "/bin/false"
- name: unpack node_exporter
unarchive:
remote_src: yes
src: https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
dest: /tmp
- name: move the node_exporter to the final destination
copy:
dest: /usr/local/bin/node_exporter
src: /tmp/node_exporter-0.18.1.linux-amd64/node_exporter
owner: node_exporter
group: node_exporter
mode: "u+x"
remote_src: yes
- name: deploy the service definition file
template:
dest: /etc/systemd/system/node_exporter.service
src: node_exporter.service
- name: deploy additional service options config file
template:
dest: /etc/nodeexport.conf
src: nodeexport.conf
- name: reload systemd to take the new service into account
systemd:
daemon_reload: yes
enabled: yes
name: node_exporter
state: started
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=node_exporter
Group=node_exporter
Type=simple
EnvironmentFile=/etc/nodeexport.conf
ExecStart=/usr/sbin/node_exporter $ARG1 $ARG2 $ARG3 $ARG5 $ARG6 $ARG7
[Install]
WantedBy=multi-user.target
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment