From 95a80ddb5fac60ed4f0e4a6f221a5ff80bd185c8 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Fri, 10 Mar 2023 00:05:04 +0100 Subject: [PATCH] updated telegraf state --- states/telegraf/config.sls | 4 ++-- states/telegraf/defaults.yaml | 2 -- states/telegraf/install.sls | 2 +- states/telegraf/service.sls | 4 ++-- states/telegraf/{ => templates}/telegraf.conf.j2 | 0 states/telegraf/{ => templates}/telegraf.service.j2 | 0 states/telegraf/{ => templates}/telegraf_default.j2 | 2 +- 7 files changed, 6 insertions(+), 8 deletions(-) rename states/telegraf/{ => templates}/telegraf.conf.j2 (100%) rename states/telegraf/{ => templates}/telegraf.service.j2 (100%) rename states/telegraf/{ => templates}/telegraf_default.j2 (67%) diff --git a/states/telegraf/config.sls b/states/telegraf/config.sls index af3ecdb..82e8e7a 100644 --- a/states/telegraf/config.sls +++ b/states/telegraf/config.sls @@ -12,10 +12,10 @@ telegraf-config-dir: telegraf-config-file: file.managed: - name: /etc/telegraf/telegraf.conf - - source: salt://telegraf/telegraf.conf.j2 + - source: salt://telegraf/templates/telegraf.conf.j2 - user: root - group: root - mode: 600 - template: jinja - watch_in: - - service: telegraf-service \ No newline at end of file + - service: telegraf-service diff --git a/states/telegraf/defaults.yaml b/states/telegraf/defaults.yaml index 42ea572..99f08b3 100644 --- a/states/telegraf/defaults.yaml +++ b/states/telegraf/defaults.yaml @@ -50,8 +50,6 @@ telegraf: urls: - '"http://localhost:8080/status"' response_timeout: "5s" - ntpq: - dns_lookup: true postfix: processes: swap: diff --git a/states/telegraf/install.sls b/states/telegraf/install.sls index f5978e3..0b87f1e 100644 --- a/states/telegraf/install.sls +++ b/states/telegraf/install.sls @@ -28,7 +28,7 @@ telegraf-bin-symlink: telegraf-defaults-file: file.managed: - name: /etc/default/telegraf - - source: salt://telegraf/telegraf_default.j2 + - source: salt://telegraf/templates/telegraf_default.j2 - user: root - group: root - template: jinja diff --git a/states/telegraf/service.sls b/states/telegraf/service.sls index e716a2f..11e6873 100644 --- a/states/telegraf/service.sls +++ b/states/telegraf/service.sls @@ -3,7 +3,7 @@ telegraf-service-file: file.managed: - name: /etc/systemd/system/telegraf.service - - source: salt://telegraf/telegraf.service.j2 + - source: salt://telegraf/templates/telegraf.service.j2 - user: root - group: root - template: jinja @@ -13,4 +13,4 @@ telegraf-service-file: telegraf-service: service.running: - name: telegraf - - enable: true \ No newline at end of file + - enable: true diff --git a/states/telegraf/telegraf.conf.j2 b/states/telegraf/templates/telegraf.conf.j2 similarity index 100% rename from states/telegraf/telegraf.conf.j2 rename to states/telegraf/templates/telegraf.conf.j2 diff --git a/states/telegraf/telegraf.service.j2 b/states/telegraf/templates/telegraf.service.j2 similarity index 100% rename from states/telegraf/telegraf.service.j2 rename to states/telegraf/templates/telegraf.service.j2 diff --git a/states/telegraf/telegraf_default.j2 b/states/telegraf/templates/telegraf_default.j2 similarity index 67% rename from states/telegraf/telegraf_default.j2 rename to states/telegraf/templates/telegraf_default.j2 index cafac8e..b912c2d 100644 --- a/states/telegraf/telegraf_default.j2 +++ b/states/telegraf/templates/telegraf_default.j2 @@ -1,3 +1,3 @@ #INFLUX_CONFIG="http://host:9999/api/v2/telegrafs/0401c1afe319d000" #INFLUX_TOKEN="test" -INFLUX_CONFIG=/etc/telegraf/telegraf.conf \ No newline at end of file +INFLUX_CONFIG=/etc/telegraf/telegraf.conf