Great ! Now all I need is some deep hash merging...
“Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us.” Bill Waterson (Calvin & Hobbes) ----- Original Message ----- From: "Abhay" <[email protected]> To: [email protected] Sent: Thursday, February 14, 2013 9:15:38 AM Subject: Re: [Puppet Users] Hiera Questions: Virtual User Resources and Hiera 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 < [email protected] > wrote: <blockquote> On Tuesday, May 22, 2012, Dan White wrote: <blockquote> 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. </blockquote> 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. <blockquote> 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. </blockquote> It is a bug, luckily we've fixed it in Puppet 3.0.x. Please give the release candidates a try. -Jeff </blockquote> -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-users?hl=en . For more options, visit https://groups.google.com/groups/opt_out . -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
