paulbsd-salt/states/telegraf/config.sls

26 lines
604 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "telegraf/map.jinja" import telegraf with context %}
telegraf-config-dir:
file.directory:
- name: /etc/telegraf
2021-08-18 07:10:35 +02:00
- user: root
- group: root
- mode: 700
2020-07-10 00:58:55 +02:00
- watch_in:
- service: telegraf-service
2024-03-20 14:32:46 +01:00
{% for cfg, value in telegraf.config.items() %}
2020-07-10 00:58:55 +02:00
telegraf-config-file:
file.managed:
2024-03-20 14:32:46 +01:00
- name: /etc/telegraf/{{ cfg }}.conf
2023-03-10 00:05:04 +01:00
- source: salt://telegraf/templates/telegraf.conf.j2
2020-07-10 00:58:55 +02:00
- user: root
- group: root
- mode: 600
- template: jinja
2024-03-20 14:32:46 +01:00
- context:
config: {{ value }}
2020-07-10 00:58:55 +02:00
- watch_in:
2024-03-20 14:32:46 +01:00
- service: telegraf-{{ cfg }}-service
{% endfor %}