Custom grains does not seem to update even when running saltutil.sync_grains
I have a custom grain creating a list:
['hadoop', 'vm-instance', 'ev1'] <type 'list'>
...then stores the list into a dictionary and returns it: {'NODEGROUPS': ['hadoop', 'vm-instance', 'ev1']} <type 'dict'>
running salt 'minion' grains.items does not return the NODEGROUPS grain. Restarting the minion service refreshes the grain and grains.items returns the custom grain.
Have you tried running salt '*' saltutil.sync_grains or salt '*' saltutil.sync_all to see if that will force a reload of your grains?
Yes tried both and the custom grains isn't available until a minion restart
Thanks. We'll investigate this.
Could we please have a --versions-report for your master/minion?
I cannot replicate this in develop. Creating a custom grain, running saltutil.sync_all and then calling grains.items shows the NODEGROUPS meeting as expected.
Please provide a --versions-report and let us know what version you're seeing this on. Thanks!
Closing for lack of response. If we can get additional information on this problem, we'll happily re-open this and investigate. Thanks.
Not sure about windows, but I can confirm this is still an issue for minions running linux with 2014.1.11. Can provide more details if required.
Salt: 2014.1.11
Python: 2.7.8 (default, Oct 2 2014, 17:06:07)
Jinja2: 2.7.3
M2Crypto: 0.22
msgpack-python: 0.4.2
msgpack-pure: Not Installed
pycrypto: 2.6.1
PyYAML: 3.11
PyZMQ: 14.3.1
ZMQ: 4.0.4
@spo0nman We had a serious regression issue in 2014.1.11 and we ended up needed to cut a 2014.1.13 release. Is this still an issue there? We also have an even newer packages with 2014.7.0. I would suggest giving either of those a try, especially 2014.7.0 because it included MANY improvements across the board to see if this is still an issue for you.
@rallytime I tested with 2014.7.0. the issue is fixed. Custom grains reflect when you do a sync_all
salt '*' saltutil.sync_all
$ salt-call --versions
Salt: 2014.7.0
Python: 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
Jinja2: 2.2.1
M2Crypto: 0.20.2
msgpack-python: 0.1.13
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.10
ioflo: Not Installed
PyZMQ: 14.4.1
RAET: Not Installed
ZMQ: 3.2.4
Mako: Not Installed
Excellent! Glad that is working for you. :)