I have been wondering how to show grains in from a more complex array, or sub grains. For example I have:
# salt winweb03 grains.item locale_info
winweb03:
----------
locale_info:
----------
defaultencoding:
cp1252
defaultlanguage:
en_US
And I want to show defaultencoding, I have tried doing
# salt winweb03 grains.item locale_info.defaultencoding
or
# salt winweb03 grains.item locale_info:defaultencoding
But I cannot seem to figure out what it should be.
---
Also I was wondering how I could print the first result of a grains array, for example:
# salt winweb03 grains.item 'ipv4'
winweb03:
----------
ipv4:
- 10.90.1.246
- 10.90.1.247
How would I print just the first IP in the above grains.item list?
Thanks for your help in advance.