I may have found the problem: Add the following block of code - you will need to have the puppet-forge module stdlib installed -- and see what it does
class java::install ( $parameters = hiera('java', []), ) { # ------------------------- start include stdlib if is_hash ( $parameters ) { notify { "It is a hash" : } } else { notify { "It is NOT a hash" : } } if $parameters { $hashkeez = keys ( $parameters ) notify { [ $hashkeez ]: message => "Key", } } # ------------------------- end if $parameters['openjdk'] == true { if $parameters['enable_v6'] == true and $java::params::openjdk_6_jre { package { $java::params::openjdk_6_jre: ensure => latest, On Wednesday, June 5, 2013 4:52:24 PM UTC-4, Ti Leggett wrote: > > It seems puppet thinks that variables evaluate to true even when they are > explicitly set to false in hiera YAML. > > In my searching it seems like this should be fixed but with hiera 1.2.1 > and puppet 3.2.1 I'm still seeing this. > > In my YAML I have: > > # Java directives > java : > enable_jdk : false # Install the JDK as well as the JRE > enable_v6 : true # Install Java 6 > enable_v7 : false # Install Java 7 > openjdk : true # Install OpenJDK > sun : false # Install Sun > > > And in one of my manifests I do something like: > > class java::install ( > $parameters = hiera('java', []), > ) { > if $parameters['openjdk'] == true { > if $parameters['enable_v6'] == true and > $java::params::openjdk_6_jre { > package { $java::params::openjdk_6_jre: > ensure => latest, > } > if $parameters['enable_jdk'] == true and > $java::params::openjdk_6_jdk { > package { $java::params::openjdk_6_jdk: > ensure => latest, > } > } > } > … > > No matter what it thinks it should install the JDK package even though the > parameter is set to false. I've tried setting it 0, False, n, and N and it > always evaluates to true. Is this a known bug and if so is there a > workaround? > > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.