paulbsd-salt/states/telegraf/service.sls

23 lines
628 B
Plaintext
Raw Permalink Normal View History

2020-07-10 00:58:55 +02:00
---
{%- from "telegraf/map.jinja" import telegraf with context %}
telegraf-service-file:
file.managed:
2024-03-20 14:32:46 +01:00
- name: /etc/systemd/system/telegraf@.service
2023-03-10 00:05:04 +01:00
- source: salt://telegraf/templates/telegraf.service.j2
2020-07-10 00:58:55 +02:00
- user: root
- group: root
- template: jinja
2024-03-20 14:32:46 +01:00
{% for cfg, value in telegraf.config.items() %}
telegraf-{{ cfg }}-service:
2020-07-10 00:58:55 +02:00
service.running:
2024-03-20 14:32:46 +01:00
- name: telegraf@{{ cfg }}
2023-03-10 00:05:04 +01:00
- enable: true
2024-03-20 14:56:04 +01:00
- watch:
- archive: telegraf-archive-extract
- file: telegraf-service-file
- file: telegraf-bin-symlink
- file: telegraf-defaults-file
- file: telegraf-config-dir
2024-03-20 14:32:46 +01:00
{% endfor %}