Ansible role to manage Netdata installation and configuration
Go to file
Jeremy Gardais 9a35df05b4
Define some vars to manage master and slaves conf
2018-08-03 14:00:51 +02:00
defaults Define some vars to manage master and slaves conf 2018-08-03 14:00:51 +02:00
handlers Simplify handler 2018-07-27 13:41:04 +02:00
meta Install Netdata 2018-07-26 17:02:22 +02:00
tasks Apply configuration according the desired state 2018-08-03 09:03:05 +02:00
templates/etc/netdata Define some vars to manage master and slaves conf 2018-08-03 14:00:51 +02:00
tests allow to change IP address and port used by Netdata 2018-07-27 14:08:43 +02:00
.travis.yml allow to change IP address and port used by Netdata 2018-07-27 14:08:43 +02:00
CHANGELOG.md Define some vars to manage master and slaves conf 2018-08-03 14:00:51 +02:00
README.md Define some vars to manage master and slaves conf 2018-08-03 14:00:51 +02:00

README.md

Netdata

  1. Overview
  2. Role Variables
  3. Example Playbook
  4. Configuration
  5. Development
  6. License
  7. Author Information

Overview

A role to manage Netdata installation and configuration.

Role Variables

  • netdata__base_packages: List of base packages in order to provide Netdata [default: netdata].
  • netdata__install_recommends: If recommends packages should be install [default: True].
  • netdata__deploy_state: The desired state this role should achieve. [default: present].
  • netdata__etc_src: Directory used as source to templating /etc/netdata configuration content [default: ../templates/etc/netdata].
  • netdata__service_name: The service name to manage [default: netdata].
  • netdata__service_manage: If the Netdata services should be managed [default: True].
  • netdata__conf_bind_ip: IP address used by Netdata to listen [default: 127.0.0.1].
  • netdata__conf_bind_port: Port used by Netdata to listen [default: 19999].
  • netdata__conf_memory_mode: The memory mode of the database [default: ram].
  • netdata__slave_enable: If node should send metrics to a master [default: False].
  • netdata__slave_destination: The destination to send metrics to [default: netdata.{{ ansible_domain }}].
  • netdata__slave_api_key: The API KEY to use to identify with the master [default: ''].
  • netdata__slave_buffer_size: The buffer to use for sending metrics [default: ``].
  • netdata__slave_reconnect: If the connection fails, or it disconnects, retry after that many seconds [default: 5].
  • netdata__master_enable: If node should receive metrics from other nodes [default: False].
  • netdata__master_api_key: The API key to authenticate slaves [default: ''].
  • netdata__master_history: The number of entries in the database per hosts [default: 3600].
  • netdata__master_memory_mode: The memory mode to be used for all hosts using this API key [default: ram].

Example Playbook

  • Use defaults vars:
- hosts: mynode.DOMAIN
  roles:
    - role: ipr-cnrs.netdata
      tags: ['role::netdata', 'ipr']
  • Use your own Netdata's configuration as source:
- hosts: mynode.DOMAIN
  roles:
    - role: ipr-cnrs.netdata
      netdata__etc_src: '{{ inventory_dir + "/../resources/host/mynode.DOMAIN/etc/netdata/" }}'
  • Ensure your directory contains only templates or sub-directories, such as:
mynode.DOMAIN
└── etc
    └── netdata
        ├── fping.conf.j2
        ├── health_alarm_notify.conf.j2
        ├── netdata.conf.j2
        └── node.d
            ├── named.conf.md.j2
            ├── README.md.j2
            ├── sma_webbox.conf.md.j2
            └── snmp.conf.md.j2
  • Listen on LAN, be careful, Netdata is not designed to be exposed (see issue 64):
- hosts: mynode.DOMAIN
  roles:
    - role: ipr-cnrs.netdata
      netdata__etc_src: '{{ inventory_dir + "/../resources/host/mynode.DOMAIN/etc/netdata/" }}'

Configuration

This role will:

  • Install needed packages to provide netdata service.
  • Manage Netdata configuration directory (/etc/netdata).
  • Ensure Netdata service is enabled and started.
  • Set up some basics configuration (bind ip, port,…).

Development

This source code comes from our Gogs instance and the Github repo exist just to be able to send the role to Ansible Galaxy…

But feel free to send issue/PR here :)

Thanks to this hook, Github automatically got updates from our Gogs instance :)

License

WTFPL

Author Information

Jérémy Gardais