Added posibility to specify output config template
Change-Id: I6723a489528c9d022fc789b4e776a424977a5ed2
Related-bug: PROD-36206
diff --git a/README.rst b/README.rst
index a4e398a..4182d5c 100644
--- a/README.rst
+++ b/README.rst
@@ -39,3 +39,31 @@
database: test-telegraf
write_consistency: any
timeout: 10s
+
+Multiple outputs of the same type
+---------------------------------
+
+.. code-block:: yaml
+
+ telegraf:
+ agent:
+ output:
+ prometheus_client:
+ bind:
+ address: 0.0.0.0
+ port: 9126
+ engine: prometheus
+ expiration_interval: 1m
+ namedrop:
+ - custom_metric
+ string_as_label: false
+ prometheus_client_custom:
+ bind:
+ address: 0.0.0.0
+ port: 9127
+ engine: prometheus
+ expiration_interval: 10m
+ namepass:
+ - custom_metric
+ string_as_label: false
+ template: telegraf/files/output/prometheus_client.conf
diff --git a/telegraf/agent.sls b/telegraf/agent.sls
index c0b5b53..e552c53 100644
--- a/telegraf/agent.sls
+++ b/telegraf/agent.sls
@@ -84,7 +84,11 @@
output_{{ name }}_agent:
file.managed:
- name: {{ agent.dir.config_d }}/output-{{ name }}.conf
+{%- if values.template is defined %}
+ - source: salt://{{ values.template }}
+{%- else %}
- source: salt://telegraf/files/output/{{ name }}.conf
+{%- endif %}
- user: root
- group: root
- mode: 640