----- "Douglas Garstang" <doug.garst...@gmail.com> wrote: > On Mon, Apr 26, 2010 at 9:17 AM, R.I.Pienaar <r...@devco.net> wrote: > > > > ----- "Douglas Garstang" <doug.garst...@gmail.com> wrote: > > > >> I wasn't able to get this to run for only CentOS. I tried a few > >> different things in the site.pp. I wish I could put a case > statement > > > > site.pp is a special file, it doesn't get evaluated on every run the > same way that classes would get. > > > > So variables like $operatingsystem can have an unpredictable value > in some cases. Best to move this logic to a class. > > It's been fine so far, but... > > I really don't see how this would work. Let's say I created a class > called os::centos, and included this class anywhere I wanted to have > the package clean functionality for CentOS. Firstly, how do you > guarantee that the package refresh is performed before any of the > packages in this module are installed? By using the site.pp file I am
first thing that jumps to mind is.. class os::setup { include "os::setup::$operatingsystem" } package{"foo": require => Class["os::setup"] . } you could also use a define to wrap the package command ensuring it gets done. -- R.I.Pienaar -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@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.