Hi all, I have a bunch of ruby script that are munging data around, part of that data is based out of hiera.
Until now, with hiera 3, I just required hiera in my ruby script, called lookup with a certain scope and I got my data out of hiera. Now looking forward to puppet not anymore shipping hiera as a gem (as everything moved to hiera 5 and hence lookup), how would I be able to use the same functionality with lookup? What I did (simplified): require 'hiera' def hiera @hiera ||= Hiera.new(:config => '/etc/hiera.yaml') end def hiera_def_scope @hiera_def_scope ||= { 'environment' => 'production' } end def hiera_lookup(key,default={}) hiera.lookup(key,default,hiera_def_scope) end mydata = hiera_lookup('mydata','a default') While I see that with lookup this might get quickly very complex with different environments, module data and so on. BUT I could imagine, that given the data in hiera is central to your infra, lots of people might also like to use that data for something else. So how to get that data out? What would you recommend to do, how would you approach the problem with getting data out of hiera in something else than puppet? Just stick around with Hiera 3 and an old non-hiera-5 config file? Which would likely be feasible if hiera stays somewhat supported, which it doesn't from my understanding?! Write your own self-supported hiera? best ~pete -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/fcfad07b-b288-a89a-c8fb-1ea977fc7313%40immerda.ch. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature