Puppet Function: openldap::values

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

Overview

openldap::values(Optional[Array[String]] $values)Optional[Array[String]]

Transforms an array of values to include a {x} positional prefix for use as the values of an OpenLDAP object attribute requiring a fixed order.

Examples:

openldap::values(['foo', 'bar'])

Parameters:

  • values (Optional[Array[String]])

    The attribute values to transform, undef is passed through unchanged.

Returns:

  • (Optional[Array[String]])

    Prefixed attribute values.

Since:

  • 2.0.0



13
14
15
16
17
18
19
20
21
# File 'functions/values.pp', line 13

function openldap::values(Optional[Array[String]] $values) {

  $values ? {
    undef   => undef,
    default => $values.map |Integer $index, String $value| {
      "{${index}}${value}"
    },
  }
}