On Thu, Apr 28, 2011 at 1:01 PM, Roberto Bouza <bouz...@gmail.com> wrote:
> That is the problem. :-)
>
> If its false/true I need to do stuff like
>
> if $enabled != undef {
>  class { 'doit': enabled => $enabled } # This here will use true or
> false to delete or add files for example
> }
>

undef, '', false all evaluate to false. However the string "false"
evaluates to true.

> But if it's undef I don't even want to include the class.
>
> I'm guessing that if this is not a valid used syntax then I'll have to
> do something like:
>
> if $enabled == true or $enabled == false {
> }
>

I'm not sure it's a good idea to take advantage of this behavior, but
in theory you can set $enabled="true"|"false" and compare the string
value in the class instead of true, false.

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-users@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