State Machines are a powerful feature of CloudForms automation. If you are unfamiliar with the concept, a state machine in the context of CloudForms automation is a series of steps that are executed sequentially by the Automation Engine.
In particular, state machines give us:
- The ability to retry steps if they fail.
- Jump between steps by name, or skip the immediately following step.
- Exceute code on enter or exit of a step, or if the step returns an error.
- Store state variables in earlier steps that can be referenced in later steps.
- Since CloudForms 4.6, we now have the ability to execute Ansible playbooks as steps in a state machine.
State machines are already used heavily for the provisioning workflows that ship with CloudForms out-of-the-box. If you’d like to know more about creating state machines, have a look at Mastering Automation in CloudForms and Manage IQ, available here on the customer portal.
State machines are undoubtedly powerful – when they work start to finish.
What happens if a state machine fails before it’s complete?