ansible-collection-kit/roles/telegraf
2023-01-31 14:27:47 +01:00
..
defaults Introduce telegraf_additional_groups variable 2023-01-31 14:26:57 +01:00
handlers Add a role to install telegraf 2023-01-22 02:33:19 +01:00
tasks Add a step to put telegraf on additional groups 2023-01-31 14:27:47 +01:00
templates/etc/telegraf Deploy telegraf.conf with only the agent part 2023-01-26 02:25:27 +01:00
README.md Deploy telegraf.conf with only the agent part 2023-01-26 02:25:27 +01:00

Telegraf

Install telegref from influxdata.com repository.

Role Variables

  • telegraf_become - Default: true. Enable/disable the Ansible become functionality.
  • telegraf_become_user - Default: root. When using become functionality for privilege escalation, this is the user with desired privileges you become.
  • telegraf_interval - Default: 10s.
  • telegraf_configs - Default: []. List of configuration files with name and content. See example below.

Example Playbook

The configuration is split in 2 files only to show it: you may want to have only one system_performance.conf.

- hosts: my-server
  vars:
    telegraf_configs:
      - name: cpu.conf
        content: |
          [[outputs.something]]
          # Your output plugin of choice

          [[inputs.cpu]]
            percpu = true
            totalcpu = true

      - name: diskio.conf
        content: |
          [[outputs.something]]
          # Your output plugin of choice

          [[input.diskio]]
  roles:
    - eriol.kit.telegraf