Generic Service State Machine

automate
gaprindashvili

#1

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?


#2

Hi

The generic state machines are intended for use with Ansible playbook services. There’s a brief description of them here: https://manageiq.gitbook.io/mastering-cloudforms-automation-addendum/embedded_ansible/chapter-2 (a WIP so possibly subject to change).

pemcg


#3

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.