0

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?

1 Answer 1

-2

Clearing the mine data has fixed this problem:

salt '*' mine.flush
1
  • That command doesn't make sense to fix grains issues. Probably you had wrong hostname or a wrong /etc/hosts file. Feb 22, 2016 at 1:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .