Puppet Function: openldap::flatten_size_limit

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

Overview

openldap::flatten_size_limit(Optional[OpenLDAP::Limit::Size] $value)Optional[String]

Flatten size limits to string form.

Examples:

openldap::flatten_size_limit('unlimited')
openldap::flatten_size_limit({'soft' => 0, 'hard' => 'unlimited'})

Parameters:

  • value (Optional[OpenLDAP::Limit::Size])

    The size limits to flatten, undef is passed through.

Returns:

  • (Optional[String])

    The flattened size limits.

Since:

  • 2.0.0



12
13
14
15
16
17
18
19
# File 'functions/flatten_size_limit.pp', line 12

function openldap::flatten_size_limit(Optional[OpenLDAP::Limit::Size] $value) {

  type($value) ? {
    Type[Hash]   => join(join_keys_to_values(prefix($value, 'size.'), '='), ' '),
    Type[Scalar] => String($value),
    default      => undef,
  }
}