Issue #2658 has been updated by Robin Bowes.

Maybe I'm mis-understanding how puppet works, but doesn't the manifest get 
generated on the server before being sent to the client? ie. the run stages 
will only need to be defined on the server?

Ryan, I think you're mis-understanding just what would be required to implement 
stages. "stages" are just a conceptual thing; what you would actually define in 
the DSL are "milestones". See for example my "diagram" in note #4 of this 
ticket (I actually call them "boundaries" rather than milestones). A 3-stage 
scenario would involve two milestones. These would be generated internally at 
the start of the manifest processing but would then function just like other 
types.

Let me work through a simple example.

Assume we have three stages: pre, main, post. This gives us two milestones (one 
between each stage):

`pre
------ milestone 1
main
------ milestone 2
post`

Resources in the manifest would by default be in the "main" stage, unless 
otherwise specified using something like:

`Package{ foo:
    ensure => installed,
    stage  => 'pre'
}`

The pre-processing would look something like this:

1. Create milestones from the stages

`milestone{ one:
    before => Milestone['two']
}
milestone{ two:
    require => Milestone['one']
}`

2. Check for resources with specific stages.
   If a resource has stage => 'pre', then add:
`      before => Milestone['one'`]
   If a resource has stage => 'post', then add
`      require => Milestone['two']`
   Otherwise add:
`      require => Milestone['one'],
      before  => Milestone['two']`

Note: this can easily be extended to work with more stages/milestones

3. Process the DSL as normal - the dependencies on the milestones will make 
sure everything runs where it should, and throw any errors if an impossible set 
of dependencies has been defined.

Now, I don't know the internals of puppet at all, but that seems to me to be a 
pretty simple solution that can be bolted without any changes to the existing 
processing of manifests - it just requires a new milestone class, and some 
pre-processing.
----------------------------------------
Feature #2658: Add puppet "run stages"
http://projects.puppetlabs.com/issues/2658

Author: Robin Bowes
Status: Needs design decision
Priority: Normal
Assigned to: Luke Kanies
Category: 
Target version: 
Affected version: 0.25.0
Keywords: 
Branch: 


Sometimes, there are certain specific manifests that you want to run before all 
others.

Similarly, there may be others that you want to run after all others have 
finished.

I'd like to see support for this added to puppet.

By default, all manifests would be "run" in the "main" stage. However, all 
types would support an additional parameter: stage => 'pre' or stage => 'post.

Anything labelled as "pre" would be executed first, followed by anything 
labelled "main" or with no explicit stage, then finally anything labelled 
"post".

The stages could even be user-defined by specifying them in some config file, 
eg:

[stages]
default=main
1=pre
2=main
3=post

Any support for this sort of idea?


-- 
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://projects.puppetlabs.com/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