On Tuesday, December 31, 2013 10:47:33 AM UTC-6, David Arroyo wrote:
>
> Our site has several dozen yum repositories. Pushing all yum repositories 
> to all servers isn't practical; it hurts performance, some repositories are 
> OS-specific, and some repositories cause conflicts with each other (we have 
> a ruby187 repo and a ruby 193 repo, for example). 
>
> In our current setup, we have one module with all our yumrepos defined 
> virtually: 
>
>         class yumrepos { 
>           @yumrepo{'puppet': 
>             … 
>           } 
>           @yumrepo{'python26': 
>             … 
>           } 
>           … 
>         } 
>
> And our various modules realize those resources as needed: 
>
>         class puppet(...) { 
>           realize Yumrepo['puppet'] 
>           … 
>         } 
>
> However, this requires every package definition to require the Yumrepo 
> resource. I can ease the pain with resource defaults, but it doesn't go 
> away completely. I have found on puppet 2.7 that virtual resources are 
> evaluated in the run stage they are defined in, not the run stage they are 
> realized in, so that I can do in site.pp: 
>
>         stage{'package-setup': before => Stage['main'] } 
>         class{'yumrepos': stage => 'package-setup' } 
>
> Then all yum repositories that a node will use are on the machine before 
> any packages are installed. Is this a kosher use of run stages?



It is exactly the sort of thing that run stages are intended for.

 

> Am I going to be surprised by something I didn't consider? I have only 
> tested this behavior in Puppet 2.7 and don't know if it is subject to 
> change in later releases. How do others handle this problem? 
>
>

Run stages remain available in Puppet 3, and I see no reason to fear that 
they will go away in the foreseeable future.  As for surprises, however, 
you are wise to be wary.  Run stages are a pretty heavy tool, and they can 
indeed cause trouble if used carelessly or excessively.  The most common 
form of trouble they are involved in is resource dependency cycles, and 
that might happen even in your limited use if you have repositories that 
are managed via packages.  With care and restraint, however, it should be 
possible to use run stages as you suggest.


John

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/9266523c-d11b-47d2-a99b-24dc8b2d8ddd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to