Ask Your Question

Pass role information to hiera.yaml

asked 2013-12-03 04:06:13 -0600

coffeejunkeysteve gravatar image

updated 2013-12-08 16:13:01 -0600

Stefan gravatar image

Hi guys,

For each Client I have a /etc/puppet/modules/hostname.yaml-file, which tells puppet which roles / classes should be applied to that client. Now I want to tell hiera to take the ".yaml"-data-sources, which are in different folders within my puppet-module. I thought I could do this by editing /etc/hiera.yaml like this:

  - %{modulename}/manifests/%{location}/%{department}/configfile
  - '/etc/puppet/modules'

--> How can I automatically pass this parameters:

  • modulename
  • location
  • department

to the /etc/hiera.yaml file?

I'm really desperate and need your help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-12-07 03:22:08 -0600

updated 2013-12-08 16:11:13 -0600

Stefan gravatar image

For variables like %{location} and %{department} you can either write a custom fact that returns their value or set a top scope variable in your ENC or site.pp. For the module name you can you Puppet's internal var %{module_name}

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: 2013-12-03 04:06:13 -0600

Seen: 315 times

Last updated: Dec 08 '13