title: Jinja2 template variables to one line
body: <p>Is it possible to create a jinja2 template that puts variables on one line?  Something like this but instead of having two lines in the results have them comma separated.</p>
  
  <p><strong>Template:</strong></p>
  
  <pre><code>{% for host in groups['tag_Function_logdb'] %}
  elasticsearch_discovery_zen_ping_unicast_hosts = {{ host }}:9300
  {% endfor %}
  </code></pre>
  
  <p><strong>Results:</strong></p>
  
  <pre><code>elasticsearch_discovery_zen_ping_unicast_hosts = 1.1.1.1:9300
  elasticsearch_discovery_zen_ping_unicast_hosts = 2.2.2.2:9300
  </code></pre>
  
  <p><strong>Desired Results:</strong></p>
  
  <pre><code>elasticsearch_discovery_zen_ping_unicast_hosts = 1.1.1.1:9300,2.2.2.2:9300
  </code></pre>
  
  <p><strong>Edit, this works for 2 items, better solution below:</strong></p>
  
  <pre><code>elasticsearch_discovery_zen_ping_unicast_hosts = {% for host in groups['tag_Function_logdb']  %}
  {{ host }}:9300
  {%- if loop.first %},{% endif %}
  {% endfor %}
  </code></pre>