Generic Service State Machine

Is /Sevice/Generic/StateMachines/GenericLifecycle class meant to be used as a sample for state machine of a Generic type of service?

Sprint 54 review presentation writes:

Goal is to use new State Machine for Ansible Playbooks, Control Actions, Orchestration and future integrations.

I was looking for some samples of a (generic) custom state machine based on this class but could not find any. The code seems to be Ansible focused to me.

@nezf did implement something similar, I wonder if he can share some of his work.

I also found this guide Custom State Machines in @pemcg’s old book but it is using a modified version of /Service/Provisioning/StateMachines/CatalogItemInitialization more suitable for VM provisioning, not generic service.

Any hints, please?


The generic state machines are intended for use with Ansible playbook services. There’s a brief description of them here: (a WIP so possibly subject to change).


Thanks, Peter.

Finally I copied the GenericLifecycle class specifying a new class name, with all the methods and the provision and retire_advanced_resource_none instances. I removed the function calls service.* from all methods (as they were not defined for a Generic type of service) and got a pretty good skeleton state machine I’m customizing now.