On Monday, 6 January 2014 15:59:53 UTC, Joseph Swick wrote: > > On 01/02/2014 03:18 AM, [email protected] <javascript:> wrote: > > How about chaining the resources, ala > > > http://docs.puppetlabs.com/puppet/2.7/reference/lang_relationships.html#chaining-arrows > > > . > > > > Yumrepo <| |> -> Package<| |> > > > > This declared in site.pp should apply globally to all nodes and would > avoid > > the use of run stages (if I understand it correctly). > > > > J > > > > One caveat to this is that if you are defining any packages (or the > YumRepos) virtually and then adding them to modules with 'realize', the > resource collector will realize all of the virtual packages, regardless > whether if you're realizing them in a module or not. This behavior is > documented in the resource chaining documentation. > > I ran into this personally with a couple of custom modules that we use > virtual packages with so that we don't get duplicate resource errors > when managing various packages. My case was very similar, I had a > custom Yum repo I wanted to ensure that was put in place before puppet > tried to install a package out of it, so I had defined the chaining > within the module for the yum repo of: > > Yumrepo['CustomRepo'] -> Package <| name == 'CustomPackage' |> > > However, when I moved the custom package into our virtual package > resources, that package started getting realized on machines that didn't > need it, but I had forgotten that I had done the above resource > chaining. Fortunately, we did provide a way to require repos with our > virtual package definitions, so I was able to remove the resource > chaining and still have the desired result. > > -- > Joseph Swick <[email protected] <javascript:>> > Operations Engineer > Meltwater Group > > Yeah I didn't spot this in the docs before I posted. Thanks for correcting me :)
J -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d071daa8-caf7-4c36-adbc-75853197ba44%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
