Puppet Function: memcached::join_interfaces

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

Overview

memcached::join_interfaces(Array[Memcached::Interface] $interfaces)String

Joins interfaces and ports together wrapping IPv6 addresses as appropriate.

Examples:

Sample usage

# '[::1],127.0.0.1:11211'
memcached::join_interfaces(['::1', ['127.0.0.1', 11211]])

Parameters:

  • interfaces (Array[Memcached::Interface])

    Array of interfaces.

Returns:

  • (String)

    Interfaces joined together.

Since:

  • 2.0.0



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

function memcached::join_interfaces(Array[Memcached::Interface] $interfaces) {

  join($interfaces.map |Memcached::Interface $interface| {
    type($interface) ? {
      Type[Tuple] => join([bodgitlib::enclose_ipv6($interface[0]), $interface[1]], ':'),
      default     => bodgitlib::enclose_ipv6($interface),
    }
  }, ',')
}