On Apr 3, 8:29 pm, Ben Hughes <b...@puppetlabs.com> wrote: > On Fri, Apr 01, 2011 at 11:19:16AM +0200, Jan wrote: > > Any ideas? What am I missing? > > If you quote the true/falses, it works. > > In the style guide, they're being used as variables for setting options of > a type: hasstatus => $trueorfalsevar. > > However, if you want to evaluate them, they need to be quoted I'm afraid. > > $installplugins = 'true' > > if ! ($installplugins in [ 'true', 'false' ]) { > fail("nrpe installplugins parameter must be true or false") > > } > > if $installplugins == 'true' { > notice( "I work, hurrah" ) > > }
Curious. From the message, I would guess that this would (also) work: if ! ("$installplugins" in [ true, false ]) { fail("nrpe installplugins parameter must be true or false") } (Since it's the *left* side of the in operator that Puppet complains about not being a string.) Of course, it's quite inconsistent that if one assigns bareword true to a variable, one cannot subsequently compare that variable against the same value, or against an array that (appears to) contain that value. I call bug, and I recommend filing a ticket. John -- 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.