Puppet Function: openldap::flatten_ldap_tls

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

Overview

openldap::flatten_ldap_tls(Optional[OpenLDAP::LDAP::TLS] $value)Optional[String]

Flatten the proxy TLS specification to string form.

Examples:

openldap::flatten_ldap_tls({'mode' => 'start', 'tls_cert' => '/tmp/cert.pem', 'tls_key' => '/tmp/key.pem'})

Parameters:

  • value (Optional[OpenLDAP::LDAP::TLS])

    The TLS specification to flatten, undef is passed through.

Returns:

  • (Optional[String])

    The flattened specification.

Since:

  • 2.0.0



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

function openldap::flatten_ldap_tls(Optional[OpenLDAP::LDAP::TLS] $value) {

  $value ? {
    undef   => undef,
    default => join([$value['mode']] + $value.filter |$x| {
      $x[0] != 'mode'
    }.map |$x| {
      "${x[0]}=${x[1]}"
    }, ' ')
  }
}