saltstack/salt — Issue #546:  _grains folder doesn't appear to work
Author: jhutchins
Created: 2012-01-19 16:35:49+00:00
State: open

It is possible that I have my setup wrong or that I don't understand what the proper function of this feature, but from what I understand if you add grains to a _grains folder in your top level salt directory (the one with the top.sls file) that it should automatically push those grains out to the minions and they should have access to them. This is not happening for me.

I have a directory setup like this:

_grains
--> my_grain.py
top.sls
my_states
--> init.sls
--> conf
--> substates
--> init.sls
--> conf

When I run the command sudo salt '*' state.highstate the my_grain.py file will get pushed out to /var/cache/salt/files/base/_grains and /var/cache/salt/extmods/grains on the minion, but the key items added with that grain cannot be accessed in templates or sls files using {{grains['name.of.key']}} and they do not appear in the list when salt-call -g is run on the minion.

I am running salt 0.9.5 on both the master and the minion.