I believe hiera_array() collects and provides an array of all the relevant elements up the entirety of the tree. To collect only the most relevant data just use hiera()
On Sep 3, 2012, at 10:21 AM, Josh <j...@chickenmonkey.co.uk> wrote: > Versions: puppet 2.7.18, hiera 0.3.0 > > I have encountered a problem that is completely counter intuitive to how I > thought hiera was meant to work. I have three levels in my hierarchy in the > following order: > - <node>.yaml (specific to the host) > - <datacentre>.yaml (we have multiple sites, this is info specific to the > site) > - common.yaml (applies to everything) > > I noticed this problem while working round a DNS problem, needless to say I > had the following (ip addresses changes to protect the innocent) in the > <datacentre>.yaml: > > dns_servers: > - '1.1.1.1' > - '2.2.2.2' > > I wanted a specific host to use different DNS so in the <node>.yaml I added: > > dns_servers: > - '3.3.3.3' > > Now, when I do a hiera_array('dns_servers') I would expect that the original > array (1.1.1.1 and 2.2.2.2) would be overwritten with a single value > (3.3.3.3)... > > As it turned out is concatenated the two arrays together, giving me (1.1.1.1 > and 2.2.2.2 and 3.3.3.3). Non-plussed I added another entry to the > common.yaml (4.4.4.4) and lo and behold it added that in as well giving me > (1.1.1.1 and 2.2.2.2 and 3.3.3.3 and 4.4.4.4). > > I really did assume from the documentation that the hierarchy would be obeyed > and both <datacentre>.yaml and common.yaml would be ignored ... or have I > misunderstood how the system works? > > Thanks > Josh > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/e-jCVgKPe6AJ. > 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. ________________________________ This message may contain confidential or privileged information. If you are not the intended recipient, please advise us immediately and delete this message. See http://www.datapipe.com/legal/email_disclaimer/ for further information on confidentiality and the risks of non-secure electronic communication. If you cannot access these links, please notify us by reply message and we will send the contents to you. -- 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.