Search code examples
salt-project

How to run a package.sls file on a minion?


I have a package.sls file with packages I want to test on my minion.
How can I run this file on my salt minion using the command line?


Solution

  • If you have a file called mypackage.sls in the current directory, this should execute all of the states within the file:

    sudo salt-call --local --file-root=. state.sls mypacakge

    • --local means run without looking for a master

    • --file-root=. means look for state files in the current directory

    • state.sls means execute the states in an sls file

    • mypackage is the name of the sls file, without the .sls extension

    Note that calling it this way will not have access to any sls includes or dependencies on the master.