I have a state called service.sls
within an "elasticsearch" directory. I could call the entire state via salt-call state.sls elasticsearch.service
but I'd only like to trigger one rule within that state.
Context: the config is file.managed
and has been changed but I'd like to manually do the restart that the state would trigger.
You can do
salt-call state.high
and specify the individual rule that you want from the file directly on the command line.Although there is an
exclude
parameter to most state functions, there isn't aninclue
. You could however exclude all other state ids to only execute the "rule" you want:salt-call state.sls elasticsearch.service exclude="[{'id': 'id_to_exclude'}, {'id': 'id_to_also_exclude'}]"