What's the difference between state.apply and state.sls? When should I use state.apply vs state.sls?
Asked
Active
Viewed 3,398 times
1 Answers
14
state.sls <state_file>
will execute the states in a specific file.
state.highstate
will execute the highstate configured by top.sls
state.apply
will do a state.highstate
if no arguments are given and a state.sls <state_file>
when a argument is given.
You can look at state.apply
as an easy way of using states command.

Gijs Brandsma
- 933
- 7
- 13
-
Thanks for the clarification – aedry Mar 15 '19 at 16:24
-
As `state.sls` takes at [least one argument](https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.state.html#salt.modules.state.sls) is safer to use it. – EsmaeelE Dec 19 '21 at 11:54