]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Add standard set of run stages.
authorJeff McCune <jeff@puppetlabs.com>
Tue, 24 May 2011 18:25:51 +0000 (11:25 -0700)
committerJeff McCune <jeff@puppetlabs.com>
Tue, 24 May 2011 18:25:51 +0000 (11:25 -0700)
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

manifests/init.pp
manifests/stages.pp

index a3f240610409140ace62da8d592d1f8c284becb9..c80456892b8845e05b4ab7487bc47800a1d2cc9c 100644 (file)
@@ -13,5 +13,6 @@
 # [Remember: No empty lines between comments and class definition]
 class stdlib {
 
+  class { 'stdlib::stages': }
 
 }
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..19cee6b87813f12bf6bb14c94033b0e81203c541 100644 (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'] }
+
+}