In Salt, both orchestration and states have timeouts. Sometimes, when creating orchestrations that depend on various states to complete, you may run into issues with orchestrations failing due to timeouts in long running states. This may be because the orchestration gives up waiting before the state has been able to complete. I will briefly describe the scenario and a solution in this article.
Let's say we need to execute a script that may take a long time to run before returning successfully. We'll use an orchestration to execution this across multiple nodes. The example we use is a bit contrived, but the setup is common enough, having an orchestration execute a state.
The orchestration state file orch.longtest.sls
will allow a Salt Minion ID to be passed in as Salt Pillar data to determine the target for the Salt State execution. If the pillar data is not provided or is Null, then the default value of testing will be used as the targeting parameter. Notice that this orchestration has a very long timeout set to allow plenty of time for this state to complete and return a response. If following along, be sure to place all files in the same directory.
VMware Aria Automation Config - all versions
SaltProject - all versions
Be sure to use the timeout option in your state or orchestration appropriately for actions that may take longer than expected to complete