paulbsd-salt/states/telegraf/config.sls
Paul Lecuq 2931ebd8bf
Some checks failed
continuous-integration/drone/push Build is failing
updated telegraf state
2024-03-20 14:32:46 +01:00

26 lines
604 B
Plaintext

---
{%- from "telegraf/map.jinja" import telegraf with context %}
telegraf-config-dir:
file.directory:
- name: /etc/telegraf
- user: root
- group: root
- mode: 700
- watch_in:
- service: telegraf-service
{% for cfg, value in telegraf.config.items() %}
telegraf-config-file:
file.managed:
- name: /etc/telegraf/{{ cfg }}.conf
- source: salt://telegraf/templates/telegraf.conf.j2
- user: root
- group: root
- mode: 600
- template: jinja
- context:
config: {{ value }}
- watch_in:
- service: telegraf-{{ cfg }}-service
{% endfor %}