Using {{ grains['host'] }} in a managed file returns the following error:
Function: file.managed
Result: False
Comment: Unable to manage file: Jinja variable dict object has no element Undefined; line 54
name = {{ grains['host'] }} <======================
Sls:
/usr/file.conf:
file.managed:
- source: salt://file.jinja
- template: jinja
- user: root
- group: root
- mode: 644
I have grains working fine elsewhere. Any thoughts?
Best Answer
Clearing the mine data has fixed this problem: