Skip to content

Instantly share code, notes, and snippets.

@discreet
Created July 15, 2014 01:23
Show Gist options
  • Save discreet/3e11a7e089101b79a68b to your computer and use it in GitHub Desktop.
Save discreet/3e11a7e089101b79a68b to your computer and use it in GitHub Desktop.
Smart-Class Parameters in Foreman
Smart-class parameters are declared in your Puppet manifests. You will see them at the top of the manifest within (). They will be in the form of $variable = array/string/boolean/yaml/json/integer,. Arrays will be within [] with each object within either '' or "" depending on how they are to be interpreted. Strings will be within "" or '' depending on how they are to be interpreted.
Examples:
( $packages = ['package1', 'package2', 'package3'],
$ensure = 'running'
$enable = true
$path = "${libpath}/nagios",)
These are automatically imported into Foreman as Smart-Class parameters. Whatever value is set in the manifest (a value can be null) is the default value given to the parameter in Foreman. When a parameter requires a change in value (an override) you need to go to the Smart-Class parameter tab of either the class, host group or host. You will see a list of all the parameters available and which class they belong to. Simply click the override button for the parameter you wish to alter the value of and scroll to the bottom of the page. At the bottom of the page you will see the parameter in a text box where you will be able to change the value. You must remember to keep the appropriate syntax of the value; array, string, boolean etc. Once you have altered the value click submit and you have now successfully altered the Smart-Class parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment