Ask Your Question

Revision history [back]

[Satellite 6] Access SAT6 global parameter in file template

Setup:

Global parameter 'webserver' set to true in SAT6

I have params.pp manifest that sets default values and pulls the values from SAT6:

class hardeningrhel::params (
  $webserver = 'false'
) {}

init.pp:

class hardeningrhel::init (
  $webserver = hardeningrhel::params::webserver
) {
  contains webserver.pp
}

webserver.pp:

class hardeningrhel::webserver {
  file { "/etc/test.txt":
    content => template('hardeningrhel/limits.conf.erb
  }
}

limits.conf.erb:

#example text
<% if @webserver == 'true' -%>
I am a webserver
<% end %->

/etc/test.txt is not populated with "I am a webserver" when ran. How can I access SAT6 global params in puppet templates?