Puppet Function: netbase::ports

Defined in:
modules/netbase/functions/ports.pp
Function type:
Puppet Language

Overview

netbase::ports(Variant[Stdlib::Port, Array[Stdlib::Port]] $filter = [])Hash[String, Netbase::Service]

SPDX-License-Identifier: Apache-2.0

Parameters:

  • filter (Variant[Stdlib::Port, Array[Stdlib::Port]]) (defaults to: [])

    a list of ports used to ensure we only return services matching the ports

Returns:

  • (Hash[String, Netbase::Service])


4
5
6
7
8
9
10
11
12
13
14
15
# File 'modules/netbase/functions/ports.pp', line 4

function netbase::ports (
    Variant[Stdlib::Port, Array[Stdlib::Port]] $filter = []
) >> Hash[String, Netbase::Service] {
    include netbase
    if $filter.empty {
        $netbase::all_services
    } else {
        $netbase::all_services.filter |$item| {
            $item[1]['port'] in Array($filter, true)
        }
    }
}