paulbsd-salt/states/telegraf/service.sls
Paul Lecuq fa60977155
All checks were successful
continuous-integration/drone/push Build is passing
updated telegraf state
2024-03-20 14:56:04 +01:00

23 lines
628 B
Plaintext

---
{%- from "telegraf/map.jinja" import telegraf with context %}
telegraf-service-file:
file.managed:
- name: /etc/systemd/system/telegraf@.service
- source: salt://telegraf/templates/telegraf.service.j2
- user: root
- group: root
- template: jinja
{% for cfg, value in telegraf.config.items() %}
telegraf-{{ cfg }}-service:
service.running:
- name: telegraf@{{ cfg }}
- enable: true
- watch:
- archive: telegraf-archive-extract
- file: telegraf-service-file
- file: telegraf-bin-symlink
- file: telegraf-defaults-file
- file: telegraf-config-dir
{% endfor %}