Ask Your Question
0

Puppet-Hiera consul backend [closed]

asked 2016-12-08 15:10:10 -0500

Please provide examples how to use the puppet-hiera module for Hiera backend consul.

Below is my implementation:

I am getting syntax errors on the backend_options paths statement. I am not sure if this is the right way to define hash inside puppet.

 class hiera_conf {

   class { 'hiera':
     backends        => ['consul'],
     hiera_yaml      => '/etc/puppetlabs/code/hiera.yaml',
     backend_options => {
       'consul' => {
          'host'  => '127.0.0.1',
          'port'  => '8500',
          'paths' => {
             '/v1/catalog/service', '/v1/catalog/node',"/v1/kv/application/%{deploy_path}",
          },
       },
     },
     hierarchy       => [
       'secure',
       "nodes/%{::hostname}",
       'common',
     ],
     eyaml => true,
   }
 }
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Redsmile
close date 2016-12-09 10:45:38.899399

2 answers

Sort by ยป oldest newest most voted
1

answered 2016-12-09 10:00:11 -0500

lupin gravatar image

updated 2016-12-09 10:01:14 -0500

I think paths value is an Array not a Hash. So it should be like:

 backend_options => {
   'consul' => {
      'host'  => '127.0.0.1',
      'port'  => '8500',
      'paths' => [
                        '/v1/catalog/service',
                        '/v1/catalog/node',
                         "/v1/kv/application/%{deploy_path}",
                        ],
   },
edit flag offensive delete link more

Comments

1

Thank you very much! yes, it was an array and when i enlosed them in the [] it worked.

Redsmile gravatar imageRedsmile ( 2016-12-09 10:45:26 -0500 )edit
2

answered 2016-12-09 07:37:27 -0500

yo61 gravatar image

puppet parser validate will tell you on what line the problem lies.

Hint: look at the different between how the two arrays hierarchy and paths are defined.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-12-08 15:10:10 -0500

Seen: 35 times

Last updated: Dec 09 '16