feat: add submodule for inputs
This commit is contained in:
parent
bb8fab5b9d
commit
e870e0971c
4 changed files with 27 additions and 0 deletions
|
@ -5,6 +5,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- add submode for inputs
|
||||||
|
|
||||||
## v1.0.0 - 2021-08-20
|
## v1.0.0 - 2021-08-20
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -38,6 +38,14 @@ Install and configure Telegraf
|
||||||
totalcpu: true
|
totalcpu: true
|
||||||
collect_cpu_time: false
|
collect_cpu_time: false
|
||||||
report_active: false
|
report_active: false
|
||||||
|
postgresql_extensible:
|
||||||
|
address: "host=localhost"
|
||||||
|
submodule:
|
||||||
|
- name: query
|
||||||
|
version = 901
|
||||||
|
sqlquery = "SELECT pg_is_in_recovery()::INT"
|
||||||
|
withdbname = false
|
||||||
|
tagvalue = ""
|
||||||
```
|
```
|
||||||
|
|
||||||
* `telegraf_outputs` - hash with outputs configuration
|
* `telegraf_outputs` - hash with outputs configuration
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
---
|
---
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
role_name: telegraf
|
role_name: telegraf
|
||||||
|
namespace: nishiki
|
||||||
author: Adrien Waksberg
|
author: Adrien Waksberg
|
||||||
company: Adrien Waksberg
|
company: Adrien Waksberg
|
||||||
description: Install and configure Telegraf
|
description: Install and configure Telegraf
|
||||||
|
|
|
@ -27,11 +27,25 @@
|
||||||
|
|
||||||
[[inputs.{{ input }}]]
|
[[inputs.{{ input }}]]
|
||||||
{% for option, value in options.items() %}
|
{% for option, value in options.items() %}
|
||||||
|
{% if option != 'submodule' %}
|
||||||
{{ option }} = {% if value is sameas true %}true
|
{{ option }} = {% if value is sameas true %}true
|
||||||
{% elif value is sameas false %}false
|
{% elif value is sameas false %}false
|
||||||
{% elif value is string %}"{{ value }}"
|
{% elif value is string %}"{{ value }}"
|
||||||
{% elif value is number %}{{ value }}
|
{% elif value is number %}{{ value }}
|
||||||
{% else %}["{{ value|join('", "') }}"]
|
{% else %}["{{ value|join('", "') }}"]
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
{% for submod in value %}
|
||||||
|
[[inputs.{{ input }}.{{ submod.name }} ]]
|
||||||
|
{% for opt, val in submod.config.items() %}
|
||||||
|
{{ opt }} = {% if val is sameas true %}true
|
||||||
|
{% elif val is sameas false %}false
|
||||||
|
{% elif val is string %}"{{ val }}"
|
||||||
|
{% elif val is number %}{{ val }}
|
||||||
|
{% else %}["{{ val|join('", "') }}"]
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue