Ask Your Question
0

hiera lookup not working?

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

minimike gravatar image

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

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)
}

...

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

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

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
0

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

Red Cricket gravatar image

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

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:

profiles::neutron::neutron_config:
   'DEFAULT/executor_thread_pool_size':
      value: 1024
  ....

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

profiles::neutron (
    $neutron_config,
) {
    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

Stats

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

Seen: 111 times

Last updated: May 22