On Thursday, March 17, 2016 at 6:29:34 PM UTC-5, Jakov Sosic wrote: > > Hi guys, > > I have interfaces bond0.2 and bond0.3 respectively (VLAN tagged). > > How can I get IP address in hiera? > > > I've tried this: > > > myvar: "%{::networking.interfaces.bond0.2.ip}" > > > but it produces error: > > SERVER: Internal Server Error: org.jruby.exceptions.RaiseException: > (Exception) Hiera type mismatch: Got Hash when Array was expected enable > lookup using key '2' > >
I had to read this question a few times to grasp what you are asking. If there is a fact involved here at all, its name is apparently "interfaces", which has no dot in it. Facts are exposed in Puppet DSL as variables, and Puppet variable names cannot contain dots. I'm not sure what Puppet would do if you tried to feed it a fact whose name actually had a dot in it. On the contrary, this appears to be about keys appearing in the *value* of a hash-valued fact. My apologies for being pedantic, but we are all best served when we communicate clearly. > I've tried escaping with backslash, singlequoting, etc, but no luck.. > > François seems to have a promising suggestion. In any event, he is quite right that the "puppet apply" command you presented doesn't mean quite what you probably thought it meant. John -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/131b8c87-519e-485d-af63-b301c613bfb9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.