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
This commit is contained in:
Jeff McCune 2011-05-24 11:25:51 -07:00
parent 6964d13b26
commit 6f8b78cc67
2 changed files with 46 additions and 0 deletions

View file

@ -13,5 +13,6 @@
# [Remember: No empty lines between comments and class definition]
class stdlib {
class { 'stdlib::stages': }
}

View file

@ -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'] }
}