Ansible role for installing Telegraf
This repository contains an Ansible role for installing and configuring Telegraf, an open source server agent to help collect metrics from stacks, sensors, and systems.
While similar roles exist, the purpose of this role is to be compatible with various platforms and architectures. Telegraf is cross-compiled and tested for different platforms.
Refer to the Platforms section of the README to view a table of platforms and architectures supported by this role.
This role is installable via Ansible Galaxy or git:
$ ansible-galaxy install jasonwalsh.telegraf
$ git clone git@github.com:jasonwalsh/ansible-role-telegraf.git roles/telegraf
After installing the role, include it in an Ansible playbook:
---
- hosts: all
roles:
- jasonwalsh.telegraf
By default, this role uses the Telegraf configuration defined in the official repository and exists in the files
subdirectory.
To use a custom configuration file, create a telegraf_conf
variable with the absolute or relative path to the configuration file.
---
# roles/x/vars/main.yml
telegraf_conf: ~/telegraf.conf
Distribution | Architectures |
---|---|
CentOS 7 | x86_64 |
Ubuntu 14.04 | x86_64 |
Ubuntu 16.04 | x86_64 |
This repository uses Ansible Molecule for testing the role. To install Molecule via pip, invoke the following command:
$ pip install molecule
After installing Molecule, invoke the following command to run the entire test suite:
$ molecule test
MIT License