Thank you very much for your reply. I did eventually get things working (nearly) the way I wanted. In the end I'm using Hiera 5 but still have a v3 global in order to get hiera-consol working. I then forked that and wrote my own custom function to get it do return data in a format I expected ... eww? But hey ... it works the way I need it to so I'm good there.
Essentially I now have a custom function (Written in ruby) that simply returns all registered services when you feed it a node, or all nodes when you feed it a service. Took awhile ot get there ... I think I cried a little ... but it's rather effective at the end of the day. On Thursday, September 14, 2017 at 11:55:01 AM UTC-7, John Baird wrote: > > Justin, > > I just wanted to say that I am currently working on implementing the > hiera_http to interact with consul. It's not nearly as clean/concise, but > it works nonetheless. > > https://github.com/crayfishx/hiera-http > > Still implementing it at the moment and testing to make sure things work, > but for now, assuming your scope is correct, works like a champ. Maybe > that would help? > > On Thursday, August 31, 2017 at 10:10:22 PM UTC-5, Justin DynamicD wrote: >> >> Unfortunately puppet lookup doesn't work at all for me, instead it's >> complaining about being unable to load some ruby gems that are related to a >> windows chocolaty module that doesn't even get called in the current >> environment. Mind you simple puppet agent -t runs and everything else is >> flawless ... but anything Hiera related has been an exercise in patience. >> Only way I've been able to test it to make a custom role::hieratest and >> assign it to my server and just invoke puppet runs over and over to see how >> the lookup works. There isn't even a module on the forge for formatting >> the global hiera.yaml on the puppet master (they all stop at v4). Custom >> template for that ... Once I get this consul integration doing what I want >> I'll do everything in my power to avoid re-configuring hiera at all costs. >> >> Integrating Consul has been a very frustrating journey, much more so than >> I anticipated when I started. >> >> Does anyone even have a list of example code I can borrow from? I can >> find videos of peopel claiming it's awesome at puppet conf but they are all >> horrifically devoid of any real detail or usable example. I can't imagine >> I'm the first person who's tried to lookup what services are registered to >> a node yet ... can't find a single working example. >> >> >> >> >> On Thursday, August 31, 2017 at 5:47:09 PM UTC-7, John Baird wrote: >>> >>> Justin, >>> >>> Funny, i'm dealing with a somewhat similar scenario, but I should let >>> you know that you CAN run lookup from CLI... >>> >>> "puppet lookup" should invoke exactly what "lookup" does from within >>> puppet, that's actually something they did amazingly well... >>> >>> On Thursday, August 31, 2017 at 11:29:02 AM UTC-5, Justin DynamicD wrote: >>>> >>>> Appreciate your feedback. After a bit of "mucking about" I've added a >>>> v5 yaml to a branch and will probably merge it in soon, but have left the >>>> global yaml inplace as v3 until I can do more testing ... >>>> >>>> That said the lookup() feature doesn't feel any easier than the old >>>> hiera statement ... arguably harder actually. hiera('var' , []) was >>>> easier >>>> to me than lookup('var', data, 'first', []) but meh, overtime maybe I'll >>>> appreciate it or at least accept it now that I can make per-environment >>>> hiera changes. >>>> >>>> Yes, the lookup seems to work like you said it would, but it seems I've >>>> only opened a can of worms: >>>> >>>> 1. I can't run lookup from the cli, only hiera. So guess I have to >>>> figure out why (maybe because the global hiera is still v3?) >>>> 2. the consul backend dumps an array of hashes ... eww ... looks like >>>> Ill have to get really clever about how to manipulate things to get the >>>> exact key/value I want ... out of scope of this question though. >>>> >>>> Thank you for your help. >>>> >>> -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ce8bcd93-dba7-44a2-a5e8-4e8749bbf2b4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
