Skip to content

Instantly share code, notes, and snippets.

@ryan-lane
Last active January 11, 2020 22:54
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 ryan-lane/b4fe7c53a6e88972496c to your computer and use it in GitHub Desktop.
Save ryan-lane/b4fe7c53a6e88972496c to your computer and use it in GitHub Desktop.
Context example
Ensure instance1 is configured:
file.managed:
- name /var/local/instance1/context.xml
- source: salt://instance.xml.tmpl
- template: jinja
- context:
var1: some content
var2: more content
Ensure instance2 is configured:
file.managed:
- name /var/local/instance2/context.xml
- source: salt://instance.xml.tmpl
- template: jinja
- context:
var1: different content
var2: {{ pillar.my_pillar }}
<a>
{{ var1 }}
{{ var2 }}
{{ pillar.some_other_pillar }}
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment