Ask Your Question

hiera lookup not working?

asked 2017-05-19 17:40:52 -0500

minimike gravatar image

updated 2017-05-19 17:41:48 -0500

Hit there

I am trying to create lookups for openstack-neutron openstack-neutron

class profiles::neutron {

  $neutron_default = lookup('neutron', {merge => deep, default_value => {}})
  create_resources('neutron', $neutron_default)


  - vswitch::ovs
  - profiles::vswitch
  - neutron
  - profiles::neutron

       rabbit_password: 'askgoogle'
       core_plugin: 'ml2'
       service_plugins: ['router']
       dns_domain: 'webterrorist.local.'
       default_transport_url: 'rabbit://openstack:askgoogle@'

but i get in stuck by

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, When rpc_backend is rabbitmq, you must set rabbit password at /usr/local/etc/puppet/environments/staging/modules/neutron/manifests/init.pp:548:7 on node test02.webterrorist.local

so it seems that my lookups in profiles::neutron where totaly ignored or/and are not working. Any hint why would be very welcome. I'm using FreeBSD 10.3 as my puppetmaster and Ubuntu 17.04 on my testing nodes. And I use puppet opensource. What would be the best to debug and testing my hiera-lookups on my testing-nodes?

class { '::neutron':
   core_plugin => hiera('neutron::core_plugin'),
   allow_overlapping_ips => true,
   service_plugins =>  hiera('neutron::service_plugins'),
   auth_strategy => 'keystone',
   dns_domain => hiera('neutron::dns_domain'),
   default_transport_url => hiera('neutron::default_transport_url'),

So far the example above would work. But then I have to change my codingstile for my yaml-files. And it's not so flexible.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-22 12:29:10 -0500

Red Cricket gravatar image

updated 2017-05-22 12:34:55 -0500

I do not think you are catching on to how class parameters and hiera work together. For example to set the password for rabbit all you need to do is have this line in your hieradata ...

neutron::rabbit_password: 'askgoogle'

... since rabbit_password is a parameter to the neutron class. If you have neutron configuration items that the neutron class did not provide a parameter for you can make use the neutron_config resource type declared by the neutron puppet module. You can use neutron_config as first parameter to the create_resource function. The second parameter to the create_resource function should be a hash of neutron configuration items that you can define in hiera. For example that hash might look like:

      value: 1024

Then your profiles::neutron class would look more like this:

profiles::neutron (
) {
    include neutron
    create_resources( neutron_config, $neutron_config )
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-05-19 17:40:52 -0500

Seen: 16 times

Last updated: 2 mins ago