Skip to content

Instantly share code, notes, and snippets.

@sroegner
Created March 12, 2014 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sroegner/9508741 to your computer and use it in GitHub Desktop.
Save sroegner/9508741 to your computer and use it in GitHub Desktop.
creating a simple serverlist string from an array in jinja
{%- set lst = ['servera', 'serverb', 'serverc'] %}
{%- set s = 'ldap://' + ',ldap://'.join(lst) %}
/tmp/gaga:
file.managed:
- contents: {{ s }}
# produces ldap://servera,ldap://serverb,ldap://serverc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment