ansible-role-telegraf/README.md

107 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

2021-08-20 07:33:22 +00:00
# Ansible role: Telegraf
2024-05-08 09:24:01 +00:00
[![Version](https://img.shields.io/badge/latest_version-1.0.0-green.svg)](https://code.waks.be/nishiki/ansible-role-telegraf/releases)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://code.waks.be/nishiki/ansible-role-telegraf/src/branch/main/LICENSE)
2024-05-09 09:49:24 +00:00
[![Build](https://code.waks.be/nishiki/ansible-role-telegraf/actions/workflows/molecule.yml/badge.svg?branch=main)](https://code.waks.be/nishiki/ansible-role-telegraf/actions?workflow=molecule.yml)
2021-08-20 07:34:52 +00:00
2021-08-20 07:33:22 +00:00
Install and configure Telegraf
## Requirements
2024-05-08 09:24:01 +00:00
- Ansible >= 2.9
- Debian
- Bookworm
2021-08-20 07:33:22 +00:00
## Role variables
2024-05-08 09:24:01 +00:00
- `telegraf_config` - hash with the general configuration (see [telegraf documentation](https://docs.influxdata.com/telegraf/latest/administration/configuration/))
2021-08-20 07:33:22 +00:00
```
agent:
interval: 10s
round_interval: true
metric_batch_size: 1000
metric_buffer_limit: 10000
collection_jitter: 0s
flush_interval: 10s
flush_jitter: 0s
precision: ''
hostname: ''
omit_hostname: false
```
2024-05-08 09:24:01 +00:00
- `telegraf_inputs` - hash with inputs configuration
2021-08-20 07:33:22 +00:00
```
cpu:
percpu: true
totalcpu: true
collect_cpu_time: false
report_active: false
2021-10-13 14:25:21 +00:00
postgresql_extensible:
address: "host=localhost"
submodule:
- name: query
version = 901
sqlquery = "SELECT pg_is_in_recovery()::INT"
withdbname = false
tagvalue = ""
2021-08-20 07:33:22 +00:00
```
2024-05-08 09:24:01 +00:00
- `telegraf_outputs` - hash with outputs configuration
2021-08-20 07:33:22 +00:00
```
file:
files: ['stdout', '/tmp/metrics.out']
```
2024-05-08 09:24:01 +00:00
- `telegraf_user_groups` - array with the telegraf unix groups
2022-05-03 08:01:59 +00:00
```
- docker
- admin
```
2024-05-08 09:24:01 +00:00
- `telegraf_proxy_url` - set a proxy url for http and https requests
- `telegraf_proxy_ignore` - array with ignore host or subnet
2022-04-04 14:43:16 +00:00
```
- localhost
- 10.0.0.0/8
```
2021-08-20 07:33:22 +00:00
## How to use
```
- hosts: server
roles:
- telegraf
```
## Development
### Test with molecule and docker
2024-05-08 09:24:01 +00:00
- install [docker](https://docs.docker.com/engine/installation/)
- install `python3` and `python3-pip`
- install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
- run `molecule test`
2021-08-20 07:33:22 +00:00
## License
```
Copyright (c) 2021 Adrien Waksberg
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```