Puppet Function: wmflib::service::lvs_ipblock

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

Overview

wmflib::service::lvs_ipblock(Hash[String,Wmflib::Service::Ipblock] $block)Hash

Given an ip block, return it in the format used by lvs::configuration

Parameters:

  • block (Hash[String,Wmflib::Service::Ipblock])

Returns:

  • (Hash)


2
3
4
5
6
7
8
9
10
11
12
# File 'modules/wmflib/functions/service/lvs_ipblock.pp', line 2

function wmflib::service::lvs_ipblock(Hash[String,Wmflib::Service::Ipblock] $block) >> Hash {
    $block.map |$site, $ipblock| {
        if length($ipblock) == 1 {
            [$site, $ipblock.values()[0]]
        }
        else {
            [$site, $ipblock]
        }
    }
    .reduce({}) |$memo, $element| { $memo + {$element[0] => $element[1]}}
}