On Thu, Oct 02, 2014 at 07:18:24AM -0700, Ciro Iriarte wrote: > El viernes, 26 de septiembre de 2014 15:21:19 UTC-4, Christopher Wood > escribió: > > In your place I'd add a level to my hiera setup and template the bird > config. > > There's a number of different options you could use to classify which > node is in which site, from the node yaml in hiera to an ENC to a fact > provisioned when the host is built. > > Trying the hiera route, I defined my configuration like this: > [root@admin ~]# cat /etc/hiera.yaml > --- > :backends: > - yaml > :hierarchy: > - defaults > - "%{clientcert}" > - "nodes/%{::fqdn}" > - "sites/%{site}" > - global > :yaml: > :datadir: > [root@admin ~]# cat /var/lib/hiera/nodes/testhost.domain.com.yaml > --- > site: 'citya' > [root@admin ~]# cat /var/lib/hiera/sites/citya.yaml > --- > snmplocation: 'That City' > ospf_area: '2000' > And trying to query for ospf_area I get null/not defined answers. Shall > this work?: > [root@admin ~]# hiera -d site ::fqdn=testhost.domain.com > citya > [root@admin ~]# hiera -d ::site ::fqdn=testhost.domain.com > nil
I've never used the '::' construct on the command line so I couldn't say what the behaviour is supposed to be. I keep my version of 'site' in an ENC besides; I've also not tried looking up the next hiera level in a higher one. > [root@admin ~]# hiera snmplocation ::fqdn=testhost.domain.com > nil > [root@admin ~]# hiera ::snmplocation ::fqdn=testhost.domain.com > nil Maybe hiera -d snmplocation fqdn=testhost.domain.com might show you what hiera is looking for? > Regards, > Ciro > > -- > 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 [1]puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > > [2]https://groups.google.com/d/msgid/puppet-users/72270b95-4ae7-40bd-9c4b-9f2e002b2e03%40googlegroups.com. > For more options, visit [3]https://groups.google.com/d/optout. > > References > > Visible links > 1. mailto:puppet-users+unsubscr...@googlegroups.com > 2. > https://groups.google.com/d/msgid/puppet-users/72270b95-4ae7-40bd-9c4b-9f2e002b2e03%40googlegroups.com?utm_medium=email&utm_source=footer > 3. https://groups.google.com/d/optout -- 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/20141002144725.GA18002%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.