Puppet Function: openldap::flatten_unique

Defined in:
functions/flatten_unique.pp
Function type:
Puppet Language

Overview

openldap::flatten_unique(Optional[Array[OpenLDAP::Unique, 1]] $values)Optional[Array[String, 1]]

Flatten an array of unique overlay uniqueness domains to an array of strings.

Examples:

openldap::flatten_unique({'uri' => ['ldap:///?uidNumber?sub']})

Parameters:

  • values (Optional[Array[OpenLDAP::Unique, 1]])

    The array of domains to flatten, undef is passed through.

Returns:

  • (Optional[Array[String, 1]])

    The array of flattened domains.

Since:

  • 2.0.0



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'functions/flatten_unique.pp', line 11

function openldap::flatten_unique(Optional[Array[OpenLDAP::Unique, 1]] $values) {

  $values ? {
    undef   => undef,
    default => $values.map |OpenLDAP::Unique $value| {
      join(delete_undef_values([
        $value['strict'] ? {
          true    => 'strict',
          default => undef,
        },
        $value['ignore'] ? {
          true    => 'ignore',
          default => undef,
        },
        join($value['uri'], ' '),
      ]), ' ')
    }
  }
}