On Wed, Mar 7, 2012 at 4:20 AM, Stefan Schulte <stefan.schu...@taunusstein.net> wrote: > Hi, > > I have the following basic node definition > > node 'mynode' { > class { 'oracle::server': } > class { 'oracle::patch::patchA': > require => Class['oracle::server'], > } > class { 'oracle::patch::patchB': > require => Class['oracle::server'], > } > oracle::instance { 'foo': > require => [ 'oracle::server', ??? ], > } > }
If you have no parameters for the patches: define oracle::load_patch { $subclass = "oracle::instance::$name" class { $subclass: require => Class['oracle::server'], } } oracle::load_patch { ['patchA','patchB']: before => Notify['end'], } notify { 'end': } Also in this case feels like require oracle::server should be in oracle::instance so you don't need to repeat it for every node. > And the following constraints > > - The foo resource depends on oracle::server but it does > also depend on ALL oracle::patch::XX classes > - The patches I want to install on different nodes may vary > > so my problem is > > - I can modify the patch classes to also specifiy `before => instanceFoo, > instanceBar` etc but this seems ugly > - Setting require => Class['oracle::patch::patchA','oracle::patch::patchB'] > for all instances does also feel wrong. > > I tried to work around this with stages but I cannot assign a stage to > oracle::instance because stages are just allowed at class level, not > resource level. > > How would you solve the issue? I thought about one parameterized > oracle::patch class that (based on a the parameters) includes the > specific patch classes. Then at oracle::instance level I only have one > require to this oracle::patch class. Or create an empty class as an anchor. > All patches will then define before => Class['empty_class'] and all instances > define require => Class['empty_class']. If you need different parameters for each patch, maybe an anchor (in stdlib), and specify each patch class before Anchor['oracle::patch']. Thanks, Nan -- 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.