All Projects → cloudalchemy → Ansible Node Exporter

cloudalchemy / Ansible Node Exporter

Licence: mit
Provision basic metrics exporter for prometheus monitoring tool

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Ansible Node Exporter

ansible-snmp-exporter
Provision SNMP metrics exporter for prometheus monitoring
Stars: ✭ 18 (-93.16%)
Mutual labels:  molecule, prometheus-exporter, tox
Ansible Telegraf
Installing and configuring Telegraf via Ansible for RedHat/Debian/Ubuntu/Windows/Suse.
Stars: ✭ 91 (-65.4%)
Mutual labels:  ansible, metrics, molecule
ansible-blackbox-exporter
Blackbox prober exporter
Stars: ✭ 60 (-77.19%)
Mutual labels:  molecule, prometheus-exporter, tox
Ansible Role Bootstrap
Prepare your system to be managed by Ansible.
Stars: ✭ 106 (-59.7%)
Mutual labels:  ansible, tox, molecule
Ansible Alertmanager
Deploy Prometheus Alertmanager service
Stars: ✭ 93 (-64.64%)
Mutual labels:  ansible, tox, molecule
Ansible Grafana
Platform for analytics and monitoring
Stars: ✭ 340 (+29.28%)
Mutual labels:  ansible, tox, molecule
Ansible Prometheus
Deploy Prometheus monitoring system
Stars: ✭ 758 (+188.21%)
Mutual labels:  ansible, tox, molecule
Ansible Dockerswarm
Docker Engine clustering using "Swarm Mode" and Ansible
Stars: ✭ 226 (-14.07%)
Mutual labels:  ansible, molecule
ansible-role-fail2ban
Install and configure fail2ban on your system.
Stars: ✭ 42 (-84.03%)
Mutual labels:  molecule, tox
ansible-role-rsyslog
Install and configure rsyslog on your system.
Stars: ✭ 14 (-94.68%)
Mutual labels:  molecule, tox
ansible-coredns
Ansible provisioning of CoreDNS
Stars: ✭ 25 (-90.49%)
Mutual labels:  molecule, tox
ansible-role-dns
Install and configure dns on your system.
Stars: ✭ 39 (-85.17%)
Mutual labels:  molecule, tox
gin-metrics
gin-gonic/gin metrics for prometheus.
Stars: ✭ 87 (-66.92%)
Mutual labels:  metrics, prometheus-exporter
aws-ec2-sg-exporter
A dockerized Prometheus exporter that compares desired/wanted IPv4/IPv6 CIDR against currently applied inbound CIDR rules in your security group(s).
Stars: ✭ 23 (-91.25%)
Mutual labels:  metrics, prometheus-exporter
ansible-fluentd
Provision fluentd log collector
Stars: ✭ 20 (-92.4%)
Mutual labels:  molecule, tox
s3 exporter
Exports Prometheus metrics about S3 buckets and objects
Stars: ✭ 65 (-75.29%)
Mutual labels:  metrics, prometheus-exporter
ansible-role-dsvpn
Install and configure dsvpn on your system.
Stars: ✭ 18 (-93.16%)
Mutual labels:  molecule, tox
resoto
Resoto - Find leaky resources, manage quota limits, detect drift, and clean up!
Stars: ✭ 562 (+113.69%)
Mutual labels:  metrics, prometheus-exporter
Ansible Prometheus
Ansible playbook for installing Prometheus monitoring system, exporters such as: node, snmp, blackbox, thus alert manager and push gateway
Stars: ✭ 69 (-73.76%)
Mutual labels:  ansible, prometheus-exporter
Molecule Ansible Docker Aws
Example project showing how to test Ansible roles with Molecule using Testinfra and a multiscenario approach with Docker, Vagrant & AWS EC2 as infrastructure providers
Stars: ✭ 72 (-72.62%)
Mutual labels:  ansible, molecule

graph logo

Ansible Role: node exporter

Build Status License Ansible Role GitHub tag

Warning

Due to limitations of galaxy.ansible.com we had to move the role to https://galaxy.ansible.com/cloudalchemy/node_exporter and use _ instead of - in role name. This is a breaking change and unfortunately, it affects all versions of node_exporter role as ansible galaxy doesn't offer any form of redirection. We are sorry for the inconvenience.

Description

Deploy prometheus node exporter using ansible.

Requirements

  • Ansible >= 2.9 (It might work on previous versions, but we cannot guarantee it)
  • gnu-tar on Mac deployer host (brew install gnu-tar)
  • Passlib is required when using the basic authentication feature (pip install passlib[bcrypt])

Role Variables

All variables which can be overridden are stored in defaults/main.yml and are listed in the table below.

Name Default Value Description
node_exporter_version 1.1.2 Node exporter package version. Also accepts latest as parameter.
node_exporter_binary_local_dir "" Allows to use local packages instead of ones distributed on github. As parameter it takes a directory where node_exporter binary is stored on host on which ansible is ran. This overrides node_exporter_version parameter
node_exporter_web_listen_address "0.0.0.0:9100" Address on which node exporter will listen
node_exporter_web_telemetry_path "/metrics" Path under which to expose metrics
node_exporter_enabled_collectors ["systemd",{textfile: {directory: "{{node_exporter_textfile_dir}}"}}] List of dicts defining additionally enabled collectors and their configuration. It adds collectors to those enabled by default.
node_exporter_disabled_collectors [] List of disabled collectors. By default node_exporter disables collectors listed here.
node_exporter_textfile_dir "/var/lib/node_exporter" Directory used by the Textfile Collector. To get permissions to write metrics in this directory, users must be in node-exp system group. Note: More information in TROUBLESHOOTING.md guide.
node_exporter_tls_server_config {} Configuration for TLS authentication. Keys and values are the same as in node_exporter docs.
node_exporter_http_server_config {} Config for HTTP/2 support. Keys and values are the same as in node_exporter docs.
node_exporter_basic_auth_users {} Dictionary of users and password for basic authentication. Passwords are automatically hashed with bcrypt.

Example

Playbook

Use it in a playbook as follows:

- hosts: all
  roles:
    - cloudalchemy.node_exporter

TLS config

Before running node_exporter role, the user needs to provision their own certificate and key.

- hosts: all
  pre_tasks:
    - name: Create node_exporter cert dir
      file:
        path: "/etc/node_exporter"
        state: directory
        owner: root
        group: root

    - name: Create cert and key
      openssl_certificate:
        path: /etc/node_exporter/tls.cert
        csr_path: /etc/node_exporter/tls.csr
        privatekey_path: /etc/node_exporter/tls.key
        provider: selfsigned
  roles:
    - cloudalchemy.node_exporter
  vars:
    node_exporter_tls_server_config:
      cert_file: /etc/node_exporter/tls.cert
      key_file: /etc/node_exporter/tls.key
    node_exporter_basic_auth_users:
      randomuser: examplepassword 

Demo site

We provide demo site for full monitoring solution based on prometheus and grafana. Repository with code and links to running instances is available on github and site is hosted on DigitalOcean.

Local Testing

The preferred way of locally testing the role is to use Docker and molecule (v2.x). You will have to install Docker on your system. See "Get started" for a Docker package suitable for your system. We are using tox to simplify the process of testing on multiple ansible versions. To install tox execute:

pip3 install tox

To run tests on all ansible versions (WARNING: this can take some time)

tox

To run a custom molecule command on a custom environment with only default test scenario:

tox -e py35-ansible28 -- molecule test -s default

For more information about molecule go to their docs.

If you would like to run tests on a remote docker host just specify DOCKER_HOST variable before running tox tests.

Travis CI

Combining molecule and travis CI allows us to test how new PRs will behave when used with multiple ansible versions and multiple operating systems. This also allows creating test scenarios for different role configurations. As a result, we have a quite large test matrix which will take more time than local testing, so please be patient.

Contributing

See contributor guideline.

Troubleshooting

See troubleshooting.

License

This project is licensed under MIT License. See LICENSE for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].