Shared values on Smart Class Parameters and/or common override values for two smart class parameters

From Foreman, what is the best practice for using the same value to be
propagated into similar fields on the two separate classes using smart
class parameters?
Global host smart parameter in Foreman?
Can I use a smart variable to override the smart class parameters for 2 or
more parameterized classes, ie it is the same in the yaml?

Let's say I have two parameterized classes
-one that installs a particular warfile and it likes to use a particular
java_home
-another class that installs the jdk and by default it uses a more recent
version, ie jdk7.

I don't want to call the myJdkInstaller directly as a class from the
myWebApp module.
No hiera.

class myWebApp (
$JavaHomeToUse = 'java-6-sun',
$webAppArchive = 'someWarFile.war', ){
include myJdkInstaller
file { webAppFile:
ensure = 'present',
source =
"puppet:///modules/myWebApp/${myWebApp::webAppArchive}",
}

class myJdkInstaller (
$JavaPackageName = 'oracle-j2sdk1.7' ){
package { theJavaPackage:
name => "$JavaPackageName",
ensure => installed,
}
}

> From Foreman, what is the best practice for using the same value to be
> propagated into similar fields on the two separate classes using smart class
> parameters?
> Global host smart parameter in Foreman?

I'd go with this, it feels the simplest solution, and encapsulates the
data nicely (i.e global data that doesn't belong to a specific class
at the global level)

> Can I use a smart variable to override the smart class parameters for 2 or
> more parameterized classes, ie it is the same in the yaml?

Sort of. Smart variables are global in scope (they end up in the
Parameters section of the yaml), but in Foreman they are assigned to a
class (there are historical reasons for that, but it needs fixing :P).
As such, you could create a smart var on one class and then reference
it in both (since it would be global as far as puppet is concerned). A
simple global param as above is probably easier though.

HTH
Greg

ยทยทยท On 7 August 2014 05:35, Thom Luxford wrote: