Skip to content

Instantly share code, notes, and snippets.

@RyPeck
Created September 30, 2014 18:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save RyPeck/00a998f379e907750145 to your computer and use it in GitHub Desktop.
{% for var, default in [("VAR1", "any"), ("VAR2", "!$VAR1")] %}
{% set value = salt['pillar.get']('pillar_name:{{ var }}', '{{ default }}') %}
{{ nodename }}-{{ var }}-file-conf:
file.replace:
- name: /etc/opt/{{ nodename }}/file.conf
- pattern: "var {{ var }}.*"
- repl: "var {{ var }} {{ value }}"
{% endfor %}
{{ value }} ends up being the string {{ default }} even if the pillar variable exists.
var VAR1 {{ default }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment