Created
September 18, 2013 20:04
-
-
Save benhosmer/6614817 to your computer and use it in GitHub Desktop.
Populate a jinja variable in a configuration file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/srv/salt/populate/init.sls: | |
{% set host_name = grains['host'] -%} | |
testfile: | |
file: | |
- managed | |
- name: /home/vagrant/testfile | |
- source: salt://populate/testfile | |
- template: jinja | |
- defaults: | |
name: {{ host_name }} | |
/srv/salt/populate/testfile: | |
This is a test-file that contains some stuff. | |
This is a jinja variable: {{ name }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment