From 3e380e242bfa997fd3375ed23c15b6167befd239 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Tue, 14 Jun 2011 20:02:17 -0700 Subject: [PATCH] Add transitive relationships to Class['nginx'] Without this change, the end user of the module may run into issues establishing relationships to the composite class (the main nginx class) For example, the user may declare this relationship expecting nginx to be managed after the yum repositories have been configured: node default { class { 'site::yumconfig': } -> class { 'nginx': } } However, all of the resources exist in implementation classes, which do not have a transitive relationship declared to the nginx class. Without this change, Puppet may very well manage Class['nginx::config'] before Class['site::yumconfig'] even though the user clearly indicated this should not be the case. --- manifests/init.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 19ce72c..8764c27 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -29,4 +29,9 @@ class nginx { include nginx::service Class['nginx::package'] -> Class['nginx::config'] ~> Class['nginx::service'] + # Allow the end user to establish relationships to the "main" class + # and preserve the relationship to the implementation classes through + # a transitive relationship to the composite class. + Class['nginx::service'] -> Class['nginx'] + }