-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

gary wrote:
> Hello,
> 
> I'm trying to do this:
> 
>    service { monit:
>       ensure => running,
>       enable => true,
>       hasrestart => true,
>       if ($operatingsystem == 'centos') {
>          hasstatus => true,
>       },
>       require => Package['monit'],
>       subscribe => File['monit.conf'],
>    }
> 
> And it doesn't work in 24.6. Perhaps setting the variable outside will
> be better. In 0.24.7, the error is a bit worse. Instead of an error,
> the class is unfindable. :)

See http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#selectors

  service { monit:
   ...
    hasstatus => $operatingsystem ? {
        centos  => true,
        default => false,
    },
}

Regards

James Turnbull

- --
Author of:
* Pulling Strings with Puppet
(http://www.amazon.com/gp/product/1590599780/)
* Pro Nagios 2.0
(http://www.amazon.com/gp/product/1590596099/)
* Hardening Linux
(http://www.amazon.com/gp/product/1590594444/)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJUaXc9hTGvAxC30ARAqJUAJ42lAJN5SlEBrBER0rQTjBPNhN67ACeO5eI
ZusMWMn33RRYttjSj+3YEeY=
=4u/8
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to