Ask Your Question

Overwriting Puppet params.pp variables with Hiera

asked 2017-06-12 07:49:24 -0600

bjones gravatar image

I want to overwrite some default variables in the params.pp file in a Puppet module. The section I am looking to do this on is an if statement:

if $::osfamily == 'RedHat' {
$defaultsiteconfig    = {
  'appname'           => "${app_appname}",
  'Organization'      => "${app_organization}",
  'WebPath'           => "/opt/${package}${package_maj_version}",
  'WebPort'           => "${app_web_port}",
  'DatabaseType'      => "${app_database_type}",

The variables:


are working fine since they are being pulled from higher up in the params.pp file. The same is happening with:


(They come up blank since they are set to undef). But, I want them to pull from hiera instead:

app::app_appname: ""
app::app_organization: ""

Is there something in Puppet that prevents this from occurring in the params.pp file since other manifests can pull those hiera variables without issue?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-06-12 20:19:16 -0600

Red Cricket gravatar image

Hiera overrides class parameters not variables. You can set the variables to the value of a class parameter. See

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-06-12 07:49:24 -0600

Seen: 698 times

Last updated: Jun 12 '17