Puppet Function: postfix::flatten_hosts

Defined in:
vendor_modules/postfix/functions/flatten_hosts.pp
Function type:
Puppet Language

Overview

postfix::flatten_hosts(Optional[Array[Variant[Postfix::Type::Lookup::LDAP::Host, Postfix::Type::Lookup::MySQL::Host, Postfix::Type::Lookup::PgSQL::Host], 1]] $hosts)Optional[Array[String, 1]]

Flatten an array of host structures to an array of strings.

Examples:

postfix::flatten_hosts(['2001:db8::1', ['192.0.2.1', 389]])

Parameters:

  • hosts (Optional[Array[Variant[Postfix::Type::Lookup::LDAP::Host, Postfix::Type::Lookup::MySQL::Host, Postfix::Type::Lookup::PgSQL::Host], 1]])

    The array of hosts to flatten, `undef` is passed through.

Returns:

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

    The array of flattened strings.

Since:

  • 2.0.0



11
12
13
14
15
16
17
18
19
# File 'vendor_modules/postfix/functions/flatten_hosts.pp', line 11

function postfix::flatten_hosts(Optional[Array[Variant[Postfix::Type::Lookup::LDAP::Host, Postfix::Type::Lookup::MySQL::Host, Postfix::Type::Lookup::PgSQL::Host], 1]] $hosts) {

  $hosts ? {
    undef   => undef,
    default => $hosts.map |$host| {
      postfix::flatten_host($host)
    },
  }
}