Whenever I try to run the sync_grains command on a host using glob matching, it works great:
root@salt:~# salt '*-stage-*' saltutil.sync_grains; echo $? i-0bbaf106121397b74-stage-knowledge-base: 0
However, any time I try matching based on grains, it fails completely:
root@salt:~# salt -C 'G@env:stage and G@role:knowledge-base' saltutil.sync_grains; echo $? i-0bbaf106121397b74-stage-knowledge-base: Minion did not return. [No response] ERROR: Minions returned with non-zero exit code 1
It still doesn't work even if I use the
-G flag instead of compound matching, so it's not that.
Now, it doesn't really make sense that you wouldn't be able to sync grains while using grains to match, since it will have already matched before running the command.
Is this a known issue? Is there a workaround?