This issue is still unresolved as of 3.1.0

# hiera -h resources -c /etc/puppet/hiera.yaml
{"webapplication2"=>{"Consumer"=>"undef"}, 
"webapplication"=>{"Consumer"=>{"2a"=>nil, "1a"=>{"offset"=>"3"}, 
"3a"=>"undef"}, "indexer"=>nil}}

____hieranil.pp________

$fullhash = hiera_hash(resources)
create_resources(noundefparams,$fullhash)

define noundefparams($Consumer="abc", $indexer="def"){
if $Consumer {  notify {"$Consumer":}   }
}

_________________
]# puppet apply hieranil.pp
Error: Received incomplete information - no value provided for parameter 
indexer at /tmp/experiment/hieranil.pp:15 on node puppet-master
Wrapped exception:
Received incomplete information - no value provided for parameter indexer
Error: Received incomplete information - no value provided for parameter 
indexer at /tmp/experiment/hieranil.pp:15 on node puppet-master


On Thursday, May 24, 2012 3:15:58 AM UTC+5:30, Jeff McCune wrote:
>
> On Tue, May 22, 2012 at 8:50 AM, Jeff McCune 
> <je...@puppetlabs.com<javascript:>
> > wrote:
>
>> On Tuesday, May 22, 2012, Dan White wrote:
>>
>>> I found an answer to this particular issue.  Thanks for the reminder so 
>>> I can share the answer:
>>>
>>> I found the hiera/yaml way to indicate an empty array !
>>> So, to use my earlier example:
>>>
>>> users:
>>>  beast:
>>>      username : beast
>>>      uid      : 6666
>>>      ingroups :
>>>          - ''
>>>      info     : Let's see if this works
>>>
>>> Then, with a hiera call, I get :
>>>
>>> {"beast"=>{"ingroups"=>[""], "uid"=>6666, "username"=>"beast", 
>>> "info"=>"Let's see if this works"}
>>>
>>> This is actually a non-empty array hat had one element, the empt string.
>>
>
> OK, I had a look today.  Much of the behavior of hashes and arrays whose 
> elements are not defined has been resolved in Puppet 3.0.0rc.  If you could 
> try that out it would help us make sure your problem has actually been 
> solved in Puppet.
>
> As to how to specify an empty array as the value of a hash key using Hiera 
> and Puppet, this is the way:
>
> --- 
>   username: beast
>   uid: 6666
>   ingroups: []
>   info: Let's see if this works
>
> Notice it's just an empty set of square braces, no empty string.
>  
>
>> This clearly seems like a bug in puppet and how it is handling Hash 
>> values. I'll take a look more as soon as I get into the office.
>>
>
> It is a bug, luckily we've fixed it in Puppet 3.0.x.  Please give the 
> release candidates a try.
>
> -Jeff 
>

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


Reply via email to