From 6e9e838a0e9abdf66e3a14bc17e35771bb453966 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Thu, 26 May 2011 10:21:42 -0700 Subject: Move stages to after main Working with the stages in stdlib, I quickly ran into an issue where most of the stages were before the main stage. This made it difficult to declare any resources in a traditional "include" style class while hiding the end user from the stages being associated with other module classes. For example, in class mcollective, a package would be declared in main. However, if mcollective declared class mcollective::service in stage infra_deploy and this was before main, there would be a dependency loop between the package and the service. There appears to be a convention around "chain your stages after main" to avoid the need to create relatively empty shell classes. --- manifests/stages.pp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'manifests') diff --git a/manifests/stages.pp b/manifests/stages.pp index 19cee6b..365b905 100644 --- a/manifests/stages.pp +++ b/manifests/stages.pp @@ -5,13 +5,13 @@ # The high level stages are (In order): # # * setup -# * deploy +# * main # * runtime # * setup_infra # * deploy_infra -# * main # * setup_app # * deploy_app +# * deploy # # Parameters: # @@ -31,15 +31,12 @@ # 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'] } + stage { 'setup': before => Stage['main'] } + stage { 'runtime': require => Stage['main'] } + -> stage { 'setup_infra': } + -> stage { 'deploy_infra': } + -> stage { 'setup_app': } + -> stage { 'deploy_app': } + -> stage { 'deploy': } } -- cgit v1.2.3