Is there a way to exclude minions from being targeted even if I run salt '*' state.apply
on CLI?
Ideally the exclusion should be declared somewhere in top.sls
You want to use compound matching. Targetting all the minions for the webserver states except minion_id_1
can be done like this.
base:
'not minion_id_1':
- match: compound
- webserver
Documentation on compound matching can be found here: docs.saltstack.com/en/latest/topics/targeting/compound.html