Hello,
grains for this purpose will be better.
Let's have look like on hostname and there are 2 way how to specify value just in file or over context in state:
/path/to/file:
file.managed:
- replace: True # To replace everytime
- source: salt://path/to/file
- template: jinja # For resolve the value in the file
- context:
host: {{ grains['host'] }}
The file where source point will look like this:
-- place somewhere in of file --
{{ host }}
-- end of file --
If you want specify value just in the file, remove context definition and in the file edit to:
-- place somewhere of file --
{{ grains['host'] }}
-- end of file --
If you want do this with grains also provide by default FQDN in grains['fqdn']
Full list what minions return you will get by command from master:
Have a good day!
Dne pátek 29. května 2015 10:14:19 UTC+2
tim.h...@gmail.com napsal(a):