On Fri, Jun 3, 2011 at 10:01 AM, Russell Howe <[email protected]> wrote:
> > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]] On Behalf Of Douglas Garstang > > Sent: 03 June 2011 16:21 > > To: [email protected] > > Subject: Re: [Puppet Users] Re: Resources existing in > > different operating systems. > > > All I was asking for was a way to conditional manage a > > resource based on the operating system. Something like: > > > > file { > > > > $operatingsystem ? { > > 'centos' => { > > "/etc/somefile": > > source => .... > > }, > > 'default' => {} > > } > > > > Haven't tried it, but I don't think that's allowed. > > > > Doug. > > How about > > case $operatingsystem { > 'centos': { $filesource = "/bar" } > default: { $filesource = "/foo" } > } > > file { "name": > source => $filesource, > # ... > } > > What if the file doesn't exist at all on the other distro? I know for example that centos creates a symlink from /boot/grub/grub.conf to /etc/grub.conf. What if I only wanted to manage this file for CentOS, and for other distro's, do nothing ? Doug. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
