Ask Your Question
0

Hiera: Unable to pass parameters to nodes after declaring class (hiera_include).

asked 2017-06-14 11:15:33 -0500

loureiro gravatar image

updated 2017-06-15 12:05:39 -0500

DarylW gravatar image

Hi,

I'm trying to move a class declaration out of the main manifest and use Hiera instead, on a new Dev environment we recently set up.

I'm using hiera_include('classes'), as I am looking at using Hiera to declare said classes and that works, the specific nodes pull the config from Puppet when I run the Puppet agent. What's not working for me is passing class parameters from Hiera, after declaring them. It just uses the default values. Specifically, I am trying to pass a new value for cassandra::datastax_repo::descr and cassandra::datastax_repo::pkg_url . Manifest code below:

class cassandra::datastax_repo (
  $descr   = 'DataStax Repo for Apache Cassandra',
  $key_id  = '7E41C00F85BFC1706C4FFFB3350200F2B999A372',
  $key_url = 'http://debian.datastax.com/debian/repo_key',
  $pkg_url = undef,
  $release = 'stable',

Do I need to add some extra config somewhere else for this to work??

For more information, I am working this module: locp-cassandra and testing declaring the cassandra::datastax_repo class.

site.pp

node 'default' {
   hiera_include('classes')
}

hiera.yaml

---
:backends:
  - yaml
:yaml:
  :datadir: "/etc/puppetlabs/code/environments/%{environment}/hieradata"
:hierarchy:
  - nodes/%{trusted.certname}
  - projects/%{project}
  - common

hieradata

---
classes:
  - cassandra::datastax_repo

cassandra::datastax_repo:
  descr: Test repo
  pkg_url: http://test.url
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-06-15 04:44:05 -0500

loureiro gravatar image

updated 2017-06-15 04:45:26 -0500

Solved, for some reason I had data_binding_terminus = none in my Puppetmaster's puppet.conf, thus disabling automatic parameter lookup from Hiera.

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-06-14 11:15:33 -0500

Seen: 19 times

Last updated: Jun 15