When using smart class parameter in Puppet module the value of the parameter is not inherited on the host.
Issue
A puppet module that uses a smart variable is assigned to two host groups, in two different lifecycle stages.
With one hostgroup in the library lifecycle the parameter is properly applied, however when the view is promoted to the next lifecycle stage, the parameter is no longer applied and appears to be empty.
The only difference between the hosts is the lifecycle stage.
The mongodb module is using a class parameter famed_template::lifecycle_stage which is set in Satellite as a smart parameter (some others are smart parameters as well but they all work).
What should be achieved, assuming this puppet module_b:
class module_b ($test_boolean = $module_a::params::test_boolean) inherits module_a::params {
if $test_boolean {
package { 'screen': ensure => 'present', }
} else {
package { 'screen': ensure => 'absent', }
}
}
The aim is to set the test_boolean variable once in Satellite for the puppet class module_a and then use it in module b.
Where to set it ?
- in puppet class module_a as a 'smart class parameter' ?
- in puppet class module_a as a 'smart variable' ? (and which one, test_boolean or module_a::test_boolean ?)
or another location ?
It is necessary to have one boolean specified somewhere, applicable to a host group, such that:
- When a host from this host group has applicable puppet class A that (un)installs a package, the host will have the package (un)installed per the boolean settings.
- And when a host from the host group has applicable puppet class B that (un)installs some another package, the host will have the package (un)installed per the same boolean settings.
Environment
Red Hat Satellite or Proxy 6.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
