Task Execution
Sake offers multiple execution strategies that controls how tasks are executed across the hosts. The available ones are:
- linear: execute task for each host before proceeding to the next task (default)
- host_pinned: executes tasks (serial) for a host before proceeding to the next host
- free: executes tasks without waiting for other tasks
You can set the strategy via the stragegy
property in a spec
definition or via a flag --strategy [option]
.
Additionally, the following properties are available to further control task execution:
- batch: number of hosts to run in parallel
- batch_p: percentage of hosts to run in parallel
- forks: max number of concurrent processes
Linear Strategy
When the following properties are set:
- strategy: linear
- batch: 2
- forks: 10000
Sake will execute according to the following image:
- Task
T1
will run in parallel for hostsH1
andH2
- Task
T1
will run for hostH3
- Task
T2
will run in parallel for hostsH1
andH2
- Task
T2
will run for hostH3
- Task
T3
will run in parallel for hostsH1
andH2
- Task
T3
will run for hostH3
Host Pinned Strategy
When the following properties are set:
- strategy: host_pinned
- batch: 2
- forks: 10000
Sake will execute according to the following image:
- Tasks
T1 - T3
will run serially forH1
andH2
(in parallel) - Tasks
T1 - T3
will run serially forH3
Free Strategy
When the following properties are set:
- strategy: free
- batch_p: 100%
- forks: 10000
Sake will execute according to the following image:
- All tasks for all hosts will run in parallel
Ordering Hosts
There are multiple host ordering options available:
- inventory: the order is as provided by the inventory
- reverse_inventory: the order is the reverse of the inventory
- sorted: hosts are alphabetically sorted by host
- reverse_sorted: hosts are sorted by host in reverse alphabetical order
- random: hosts are randomly ordered
Confirm Before Running Tasks
sake comes with two options to confirm tasks before execution:
- confirm: this property is used when you want to simply confirm the task you invoked before running
- it can be specified either via flag
--confirm
or the spec propertyconfirm
- it can be specified either via flag
- step: this property is used when you want to confirm each task individually
- it can be specified either via flag
--step
or the spec propertystep
- Invoking
--step
will provide the user 3 options:yes
: run the taskno
: skip the taskcontinue
: run the task and don't prompt for the next tasks
- Invoking
- it can be specified either via flag