Issue #625 has been updated by Luke Kanies.

Affected version set to 0.24.8

Moving the wiki 'spec' here:

The short version is that ensure should treat resources like state machines; 
e.g., mounted filesystems should move from absent to present then to mounted. 
If we do this, then we can create the appropriate methods on the providers, and 
ensure just needs to declare which methods are responsible for a given state 
machine.

This also provides for what often ends up being a somewhat unique interface 
between the ensure property and providers. For instance, packages directly call 
install or uninstall, rather than using ensure=(:install) like normal 
properties would do. This actually makes sense when you are talking about state 
transitions, because you're going to want to call many different methods on the 
provider, rather than being restricted to one method with different arguments.

This does restrict ensure so that you have to declare all of the "states" 
specifically, so that you can declare the transitions, but that's done almost 
across the board right now anyway.

A good example of how this could be done is in the zone type, which already 
uses this basic flow. It just needs to be generalized.
----------------------------------------
Feature #625: Convert 'ensure' to use a state machine
http://projects.reductivelabs.com/issues/625

Author: Luke Kanies
Status: Accepted
Priority: Normal
Assigned to: community -
Category: RAL
Target version: unplanned
Complexity: Unknown
Patch: None
Affected version: 0.24.8
Keywords: 


See the specification at [[ResourceStateMachines]].

Discussions with Allen Ballman got me far enough that I think we know what 
we're doing, and he's volunteered to work on the first step:  Creating a module 
that can handle the state machine operations.

Backward compatibility is only 'limited' because it will involve some 
deprecation -- e.g., the 'enabled' property on services will likely go away, 
and instead most services are likely to have 'enabled' as a state between 
'absent' and 'running'.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to