Puppet Function: wmflib::to_yaml

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

Summary

wrap tohe to yaml function allowing one to strip the yaml doc header '---\n'

Overview

wmflib::to_yaml(Any $data, Boolean $strip_header = true) ⇒ Any

SPDX-License-Identifier: Apache-2.0

Parameters:

  • data (Any) —

    the data to convery

  • strip_header (Boolean) (defaults to: true) —

    if we should strip the header

Returns:

  • (Any) —

    The yaml document



6
7
8
9
10
11
12
13
14
# File 'modules/wmflib/functions/to_yaml.pp', line 6

function wmflib::to_yaml (
    Any     $data,
    Boolean $strip_header = true,
) {
    $strip_header.bool2str(
        $data.stdlib::to_yaml[4,-1],
        $data.stdlib::to_yaml
    )
}