Puppet Function: simplib::inspect
- Defined in:
- functions/inspect.pp
- Function type:
- Puppet Language
Overview
Prints the passed variable's Ruby type and value for debugging purposes
This uses a Notify
resource to print the information during
the client run.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'functions/inspect.pp', line 13
function simplib::inspect (
String $var_name,
Enum['json','yaml'] $output_type = 'json'
) {
$var_value = inline_template("<%= scope[@var_name].to_${output_type} %>")
$var_class = inline_template('<%= scope[@var_name].class %>')
notify { "DEBUG_INSPECT_${var_name}":
message => "Type => ${var_class}\nContent =>\n${var_value}"
}
}
|