Puppet Function: admin::unique_users

Defined in:
modules/admin/functions/unique_users.pp
Function type:
Puppet Language

Overview

admin::unique_users(Array[String[1]] $groups)Array[String[1]]

SPDX-License-Identifier: Apache-2.0

Parameters:

  • data

    the admin data loaded from data.uaml

  • groups (Array[String[1]])

Returns:



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'modules/admin/functions/unique_users.pp', line 4

function admin::unique_users (
    Array[String[1]] $groups,
) >> Array[String[1]] {

    include admin

    $groups.reduce([]) |$memo, $group| {
        if $group in $admin::data['groups'] {
            $memo + $admin::data['groups'][$group]['members']
        } else {
            $memo
        }
    }.flatten.unique
}