Puppet Function: profile::contacts::get_owners
- Defined in:
- modules/profile/functions/contacts/get_owners.pp
- Function type:
- Puppet Language
Overview
SPDX-License-Identifier: Apache-2.0
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'modules/profile/functions/contacts/get_owners.pp', line 2
function profile::contacts::get_owners (
) {
$pql = @("PQL")
resources[certname,tags,parameters] {
type = "Class" and title = "Profile::Contacts"
}
| PQL
Hash(wmflib::puppetdb_query($pql).filter |$r| { !$r['parameters']['role_contacts'].empty }.map |$resource| {
$contacts = $resource['parameters']['role_contacts']
# We just pick the first one, this should be fine if everything follows the policy
# but there are a couple of outliers, either way it should be fine
$role_tag = $resource['tags'].filter |$t| { $t.stdlib::start_with('role::') }[0]
[$role_tag, $contacts]
}.sort)
}
|