Salt allows users to assign machines to environments by setting in /etc/salt/minion:
environment: example
You can then execute environments for that state with the command salt '*' state.apply saltenv=example
However, it appears that the same cannot be said for an arbitrary command. Running salt '*' cmd.run 'df -h' saltenv=example
will run on all minions instead of just the minions in the "example" environment. How can I run commands for only a specified environment?