Enable other formulas to provide Telegraf config

This change allows other formulas to provide their own templates to
generate their plugin configuration. It will simplify the integration
of StackLight since it doesn't require anymore to modify both the
the monitored service formula and the Telegraf formula.

Change-Id: I3f7ca67aa968cbd79d25ad85cddaeeeef23c4be3
diff --git a/telegraf/agent.sls b/telegraf/agent.sls
index 249ab22..d04385f 100644
--- a/telegraf/agent.sls
+++ b/telegraf/agent.sls
@@ -35,6 +35,9 @@
   file.managed:
     - name: {{ agent.dir.config_d }}/input-{{ name }}.conf
     - source:
+{%- if values.template is defined %}
+      - salt://{{ values.template }}
+{%- endif %}
       - salt://telegraf/files/input/{{ name }}.conf
       - salt://telegraf/files/input/generic.conf
     - user: root
diff --git a/telegraf/remote_agent.sls b/telegraf/remote_agent.sls
index d79ffb3..f7123f1 100644
--- a/telegraf/remote_agent.sls
+++ b/telegraf/remote_agent.sls
@@ -46,6 +46,9 @@
   file.managed:
     - name: {{ remote_agent.dir.config_d }}/input-{{ name }}.conf
     - source:
+{%- if values.template is defined %}
+      - salt://{{ values.template }}
+{%- endif %}
       - salt://telegraf/files/input/{{ name }}.conf
       - salt://telegraf/files/input/generic.conf
     - user: root