Puppet Function: puppetdb::query_facts
- Defined in:
- modules/puppetdb/functions/query_facts.pp
- Function type:
- Puppet Language
Overview
SPDX-License-Identifier: Apache-2.0
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'modules/puppetdb/functions/query_facts.pp', line 5
function puppetdb::query_facts(
Array[String[1]] $filter,
Optional[String[1]] $subquery = undef,
) >> Hash[Stdlib::Fqdn, Hash] {
$_subquery = $subquery ? {
undef => '',
default => " and ${subquery}"
}
$filter_str = $filter.map |$filter| { "\"${filter}\"" }.join(',')
$pql = "facts[certname, name, value] { name in [${filter_str}] ${_subquery} }"
puppetdb::munge_facts(wmflib::puppetdb_query($pql))
}
|