Issue #3704 has been updated by Miguel Filho.
Bumping this bug.
The following code does not work and gives this error: "Could not retrieve
catalog from remote server: Error 400 on SERVER: No matching value for selector
param 'true' at /etc/puppet/modules/elabsis/manifests/ntp.pp:6 on node
puppet1.elabsis.com"
<pre>
package {"ntp":
ensure => $::is_virtual ? {
true => purged,
false => installed,
}
}
</pre>
This one works:
<pre>
package {"ntp":
ensure => $::is_virtual ? {
'true' => purged,
'false' => installed,
}
}
</pre>
----------------------------------------
Bug #3704: Facter doesn't return booleans (converts them to strings instead)
https://projects.puppetlabs.com/issues/3704
Author: Sebastian Kayser
Status: Accepted
Priority: Normal
Assignee:
Category: library
Target version: 2.0.0
Keywords:
Branch:
Affected Facter version:
I am just getting started with puppet/facter and it took me a quite while to
realize that facter seems to convert custom boolean facts to strings (tried
boolean comparisons in my puppet recipes for ages before realizing it). This
has also been reported here
http://groups.google.de/group/puppet-users/msg/c1939ed3b4404668 where Luke
asked to file a bug report. As I couldn't find one, here it goes.
Example:
<pre>
$ ls
test.pp test.rb
$ cat test.rb
Facter.add("myfact") do
setcode do
true
end
end
$ cat test.pp
notice($myfact)
if $myfact == true {
notice("Boolean ... just like I expected!")
} else { if $myfact == 'true' {
notice("Houston ... it's a string!")
}}
$ FACTERLIB=. puppet test.pp
notice: Scope(Class[main]): true
notice: Scope(Class[main]): Houston ... it's a string!
$ puppet --version
0.25.4
$ facter --version
1.5.7
</pre>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" 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-bugs?hl=en.