Hi,

anyone have some good concise examples on how to setup using a consul 
backend in hiera?  I've attempted with little luck to get this backend to 
work.

So far these are the steps I've tried:

1.  Imported lynxman/hiera-consul into in the Puppetfile
2.  Modified puppetserver.conf "ruby-load-path" to include the agent libdir 
(and presumably pickup the consul_backend.rb) 
via: 
https://tickets.puppetlabs.com/si/jira.issueviews:issue-html/SERVER-571/SERVER-571.html
3.  Validated basic hiera yaml was working by creating a simple 
"common.yaml" and ensured variables were being picked up during puppet runs 
(this was mostly to ensure hiera as a subsystem was t least functioning).
4.  Verified I can directly query consul with either consul kv, curl, and 
even dig.

With all this in place, I can't seem to get any info back.  For a fun test 
I created a truly "simply" little class:

class hieratest (
  $getdata = hiera('%{::hostname}'), ) {

  $myresult = join($getdata, ",")

  file { '/root/dump.txt' :
    ensure  =>  present,
    content => inline_template($myresult),
  }

}



As you can see this does very little other than perform a hiera lookup (for 
hostname) and then dump the output into a file so I can see what it's 
gathering.  

The file is always empty.

I've tried a few different variations to attempt to get data out, but I'm 
not certain of how.  What I'd like to emulate is simply:

consul catalog services -node=<nodename>

This simple command returns all the services registered to a specified node 
as an array.  That's basically all I'm trying to get back from consul via 
hiera so I can then use simple If "application" in $getdata".

Anyone have any insight on what setting I might be missing?  Simple syntax 
issue?  consul trick?


-- 
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/d1bc486f-6994-4a97-bf17-9d9b374c1be3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to