...

Open source softwares - SaltStack

Back to Course

Lesson Description


Lession - #1532 SaltStack Orchestration


Orchestration is automated coordination and arrangement of systems. Orchestrate runner is used to perform the orchestration in saltstack.

Orchestrate Runner

Orchestrate Runner offers all the functionality of the overstate. It's originally called thestate.sls runner. This orchestrate runner is used to generalizing the Salt state system to a Salt master context. Thestate.sls and the state. high state functions are executed on each Salt minion, but the state. orchestrate runner is executed on the master. The state. orchestrate runner allows you to manage your entire infrastructure as a state completely. Let us understand how to go through a simple execution process.

Simple Execution

The Orchestrate Runner command is the same as thestate.sls function, but you can execute it with the “ salt- run ” rather of salt.

we have asample.sls file located at/ srv/ salt/ orch/sample.sls and add the following code in that file.


#catsample.sls 
 
 
salt.state 
 
- tgt' web *' 
- sls 
 
- nginx 

 


The following command is used to run on the master and it'll apply the states defined in that file.


#salt- runstate.orchestrateorch.sample 
 


Execute Function

To execute a function, we should use thesalt.function. Consider a filedata.sls located at/ srv/ salt/ orch/data.sls. Now, add the following changes in that file.


data.sls 
cmd.run 
 
 
- tgt' *' 
 
- arg 
- rm- rf/ tmp/ data 
 


The following command is used to execute the Salt function.


#salt- runstate.orchestrateorch.data