Puppet Plan: patching::get_facts
- Defined in:
-
plans/get_facts.pp
Summary
Sets patching facts on targets
Overview
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'plans/get_facts.pp', line 15
plan patching::get_facts (
TargetSpec $targets,
Variant[String, Array[String]] $names = ['patching_group'],
) {
# this will set all of the facts on the targets if they have Puppet or not
$_targets = run_plan('patching::get_targets', $targets)
# make sure facts is an array so we can treat it consistently
if $names =~ Array {
$_names = $names
}
else {
$_names = [$names]
}
$_results = $_targets.map |$t| {
$target_facts = $_names.reduce({}) |$memo, $n| {
$memo + {$n => facts($t)[$n]}
}
Result($t, $target_facts)
}
return ResultSet($_results)
}
|