Puppet Function: wmflib::hosts2ips

Defined in:
modules/wmflib/functions/hosts2ips.pp
Function type:
Puppet Language

Summary

converts a list of hosts to a list of ip addresses

Overview

wmflib::hosts2ips(Array[Stdlib::Host] $hosts)Array[Stdlib::IP::Address]

SPDX-License-Identifier: Apache-2.0

Parameters:

  • hosts (Array[Stdlib::Host])

    a list of hosts to convert

Returns:

  • (Array[Stdlib::IP::Address])


4
5
6
7
8
9
10
11
12
13
# File 'modules/wmflib/functions/hosts2ips.pp', line 4

function wmflib::hosts2ips (
    Array[Stdlib::Host] $hosts,
) >> Array[Stdlib::IP::Address] {
    $hosts.map |$host| {
        $host ? {
            Stdlib::IP::Address => $host,
            default             => dnsquery::lookup($host, true)
        }
    }.flatten.sort
}