1

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.

c4urself
  • 5,270
  • 3
  • 25
  • 39

2 Answers2

1

You can do salt-call state.high and specify the individual rule that you want from the file directly on the command line.

Jeff Ferland
  • 20,239
  • 2
  • 61
  • 85
1

Although there is an exclude parameter to most state functions, there isn't an inclue. 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'}]"

Marvin Frick
  • 196
  • 4