Here's how I do it.

if ( $operatingsystem == "SLES" ) and ( $operatingsystemrelease ==
"10" ){
        include SLES_10
    }

if ( $operatingsystem == "SLES" ) and ( $operatingsystemrelease ==
"11" ){
        include SLES_11
    }


Of course run facter to check the variables. But you get the idea.




On Aug 12, 5:15 am, Nan Liu <n...@puppetlabs.com> wrote:
> On Wed, Aug 11, 2010 at 12:52 PM, Nigel Kersten <nig...@google.com> wrote:
>
> > > $os_release = "${operatingsystem}-${operatingsystemrelease}"
>
> > > $pkg = ${os_release} ? {
> > >   /^OEL-/ =>  redhat-lsb,
> > >   /^SLES-11./ =>  lsb,
> > >   default =>  redhat-lsb,
> > > }
>
> > > package { $pkg:
> > >   ensure => installed,
> > > }
>
> > Won't that try to install 'redhat-lsb' on SLES 10 ?
>
> Yes, that's wrong. Originally, I wanted to set /^SLES-10/ to something
> standard that comes with the distro, but didn't seem like the right
> solution, and leaving out that line ended up with something that's
> definitely incorrect.
>
> > I think you want
>
> > ensure => undef
>
> > for SLES 10 if you truly want to not manage it.
>
> I did some testing, undef doesn't appear to work since ensure is a required
> parameter and undef is not a valid value. Setting package ensure=>undef will
> install the package rather than unmanaged. I guess absent would be
> acceptable?
>
> package { $pkg:
>   ensure =>  ${os_release} ?
>     /^SLES-10/ = absent,
>     default => installed,
>   }
>
> }
>
> 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-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.

Reply via email to