Ask Your Question

Revision history [back]

Foreman: Expand a global variable as class parameter

We use Foreman as ENC; and I define some global variables there. How can I use such a global in a class parameter and get it expanded?

Example

In manifests, this works as expected:

class myclass ($parameter = $::global_variable) {notify {'parameter is:': message => $parameter} }

Importing myclass in Foreman, the parameter looks like this

  • parameter type: string
  • value: ${$::global_variable}

When I override the value and put in the same value as sting, it results in:

Notice: /Stage[main]/Myclass/Notify[parameter is:]/message: defined 'message' as '${$::global_variable}'