On Sat, Aug 13, 2011 at 10:01 AM, dieterdm <dieterdeme...@gmail.com> wrote:

> Hello,
>
> I have a module that includes several other modules to setup a developer
> workstation.
> Several classes have to run according to a predefined order so I'm using
> resource chaining for this.
> But the problem is that a certain module I include follows the principles
> of Example42 's Puppet modules of splitting up resources in classes
> according to the operating system.
> Example:
>
> class sunjdk {
>
>     include sunjdk::params
>
>     case $operatingsystem {
>         redhat, centos: { include sunjdk::redhat }
>         ubuntu: { include sunjdk::ubuntu }
>         default: {}
>     }
>
> }
>
>
> When I include this specific class in my developer-workstation module
> below, the resource chaining doesn't work anymore..
>
> class dev-workstation-setup($user) {
>
>     File["install-dir"] -> File["data-dir"] -> Class["vcs"] ->
> Class["sunjdk"] -> Class["apache-ant"] -> Class["apache-tomcat"] ->
> Class["eclipse"]
>
>     $install_root = "/opt"
>     $data_root = "/data"
>
>     file {
>         "install-dir" :
>             ensure  => directory,
>             path    => "${install_root}",
>             owner   => "$user",
>             group   => "$user";
>
>         "data-dir" :
>             ensure  => directory,
>             path    => "${data_root}",
>             owner   => "$user",
>             group   => "$user";
>     }
>
> include sunjdk
> include vcs
>
>     class { "apache-ant" :
>         user => "$user",
>     }
>
>     class { "apache-tomcat" :
>         user => "$user",
>     }
>
>     class { "eclipse" :
>         user => "$user",
>     }
>
> }
>
> Does anyone have any idea on how to fix this?
> Can this be a bug in Puppet?  Or am i doing something wrong?
>
> Thanks in advance...
>

Dieter,

Puppet may be non-deterministic, but its parser is top-down, which means
that your include statements and class declarations must come BEFORE you do
your resource chaining (which references those resources).  Put the chain at
the bottom of your class and try it again :)



>  --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/3EEm7U1oWPsJ.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>



-- 

Gary Larizza
Professional Services Engineer
Puppet Labs

Join us for PuppetConf <http://bit.ly/puppetconfsig>, September 22nd and
23rd in Portland, OR!

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to