Variable examples

 

Variable assigned an array value

A variable being assigned a set of values as an array.

$package_list = ['ntp', 'apache2', 'vim-nox', 'wget']

For details about assigning values to variables, see Variables.

Variable assigned a hash value

A variable being assigned a set of values as a hash.

$myhash = { key => { subkey => 'b' } }

For details about assigning values to variables, see Variables.

Interpolated variable

A built-in variable provided by the primary server being interpolated into a double-quoted string.

...
content => "Managed by Puppet Server version ${serverversion}"

For details about built-in variables usage and syntax, see Facts and built-in variables. For information about strings and interpolation, see Strings.