Add possibility to configure multiple outputs
Change-Id: I2c54fe90ebeb9a0330912dce02eded4a018a1c49
Related-Bug: PROD-19062
diff --git a/telegraf/files/output/generic.conf b/telegraf/files/output/generic.conf
new file mode 100644
index 0000000..0623516
--- /dev/null
+++ b/telegraf/files/output/generic.conf
@@ -0,0 +1,2 @@
+[[outputs.{{ name }}]]
+{%- include 'telegraf/files/input/_filters.conf' %}
diff --git a/telegraf/files/output/prometheus_client.conf b/telegraf/files/output/prometheus_client.conf
index b60f26a..eb7d7fc 100644
--- a/telegraf/files/output/prometheus_client.conf
+++ b/telegraf/files/output/prometheus_client.conf
@@ -1,7 +1,8 @@
-[[outputs.{{ name }}]]
+[[outputs.prometheus_client]]
{%- if values is defined %}
listen = "{{ values.bind.address }}:{{ values.bind.port }}"
-{%- if values.expiration_interval is defined %}
+{%- if values.expiration_interval is defined %}
expiration_interval = "{{ values.expiration_interval }}"
-{%- endif %}
{%- endif %}
+{%- endif %}
+{%- include 'telegraf/files/input/_filters.conf' %}
diff --git a/telegraf/remote_agent.sls b/telegraf/remote_agent.sls
index d96d351..45bb734 100644
--- a/telegraf/remote_agent.sls
+++ b/telegraf/remote_agent.sls
@@ -95,7 +95,12 @@
output_{{ name }}_remote_agent:
file.managed:
- name: {{ remote_agent.dir.config_d }}/output-{{ name }}.conf
- - source: salt://telegraf/files/output/{{ name }}.conf
+ - source:
+{%- if values.template is defined %}
+ - salt://{{ values.template }}
+{%- endif %}
+ - salt://telegraf/files/output/{{ name }}.conf
+ - salt://telegraf/files/output/generic.conf
- user: root
- group: root
- mode: 644