diff options
| author | Jeff McCune <jeff@puppetlabs.com> | 2011-05-24 11:25:51 -0700 | 
|---|---|---|
| committer | Jeff McCune <jeff@puppetlabs.com> | 2011-05-24 11:25:51 -0700 | 
| commit | 6f8b78cc67e1b4ccb4b16b9264e0e6ae5313962f (patch) | |
| tree | f9f5fb84dc0e1a88160934e3d3a553b88c7ec3cd | |
| parent | 6964d13b2637655dae828d882cf292ef251f378d (diff) | |
| download | puppet-stdlib-6f8b78cc67e1b4ccb4b16b9264e0e6ae5313962f.tar.gz puppet-stdlib-6f8b78cc67e1b4ccb4b16b9264e0e6ae5313962f.tar.bz2  | |
Add standard set of run stages.
Many modules I'm working on need a standard but
relatively granular location in the catalog.  For example,
any module that configures the packaging system should
run "early"
Add the following stages which have inter-dependencies
in the top to bottom order listed:
 * setup
 * deploy
 * runtime
 * setup_infra
 * deploy_infra
 * main
 * setup_app
 * deploy_app
| -rw-r--r-- | manifests/init.pp | 1 | ||||
| -rw-r--r-- | manifests/stages.pp | 45 | 
2 files changed, 46 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index a3f2406..c804568 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,5 +13,6 @@  # [Remember: No empty lines between comments and class definition]  class stdlib { +  class { 'stdlib::stages': }  } diff --git a/manifests/stages.pp b/manifests/stages.pp index e69de29..19cee6b 100644 --- a/manifests/stages.pp +++ b/manifests/stages.pp @@ -0,0 +1,45 @@ +# Class: stdlib::stages +# +# This class manages a standard set of Run Stages for Puppet. +# +# The high level stages are (In order): +# +#  * setup +#  * deploy +#  * runtime +#  * setup_infra +#  * deploy_infra +#  * main +#  * setup_app +#  * deploy_app +# +# Parameters: +# +# Actions: +# +#   Declares various run-stages for deploying infrastructure, +#   language runtimes, and application layers. +# +# Requires: +# +# Sample Usage: +# +#  node default { +#    include stdlib::stages +#    class { java: stage => 'runtime' } +#  } +# +class stdlib::stages { + +  stage { 'setup':  before => Stage['deploy'] } +  stage { 'deploy': before => Stage['setup_infra'] } +  stage { 'runtime': +    require => Stage['deploy'], +    before  => Stage['setup_infra'], +  } +  stage { 'setup_infra':  before  => Stage['deploy_infra'] } +  stage { 'deploy_infra': before  => Stage['main'] } +  stage { 'setup_app':    require => Stage['main'] } +  stage { 'deploy_app':   require => Stage['setup_app'] } + +}  | 
