How can I configure custom grains for Windows VM? I tried few things as shown below but none of them works. It works fine for Linux servers. I have many linux servers with custom grains in a separate file. It just doesn't work for Windows servers.
I tried configuring custom grains in a separate file and it's not working
c:\salt\grains:
environment: production
I also tried setting the grains in minion config and restarted salt-minion yet I can't see the custom grains when I run the command salt 'wintest-001' grains.items on master server.
C:\salt\minion:
hash_type: sha256
id: wintest-001
ipc_mode: tcp
log_level: info
master: 10.10.10.10
master_finger: 51:81:19:f0:dd:30:35:4c:8c:26:5d:c7:a6:0d
multiprocessing: false
pki_dir: /conf/pki/minion
root_dir: c:\salt
grains:
environment: production
Any idea what is the proper way to define custom grains for windows?
This is a known bug in 3005.x onedir Windows installations