Skip to content

Instantly share code, notes, and snippets.

@Inveracity
Created May 18, 2017 16:17
Show Gist options
  • Save Inveracity/4fa8a181ebe6b9ce6d9cd7bf19564fe2 to your computer and use it in GitHub Desktop.
Save Inveracity/4fa8a181ebe6b9ce6d9cd7bf19564fe2 to your computer and use it in GitHub Desktop.
#grains in yaml format
dictkey:
- "list element 0"
- "list element 1"
- "list element 2"
#jinja2
{% set myitem = grains['dictkey'][1] %}
some state:
my.state:
- name: {{ myitem }} # This produces "list element 1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment