Puppet Function: tp::ensure2bool

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

Overview

tp::ensure2bool(Variant[Boolean,String] $input = present, Any $default = undef)Any

Parameters:

  • input (Variant[Boolean,String]) (defaults to: present)
  • default (Any) (defaults to: undef)

Returns:

  • (Any)


1
2
3
4
5
6
7
8
9
10
11
12
# File 'functions/ensure2bool.pp', line 1

function tp::ensure2bool (
  Variant[Boolean,String] $input  = present,
  $default = undef,
) {
  $output = $input ? {
    'absent'  => false,
    false     => false,
    'present' => true,
    true      => true,
    default   => $default,
  }
}