Puppet Function: tp::ensure2service

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

Overview

tp::ensure2service(Variant[Boolean,String] $input = present, Enum['ensure','enable'] $param = 'ensure')Any

Parameters:

  • input (Variant[Boolean,String]) (defaults to: present)
  • param (Enum['ensure','enable']) (defaults to: 'ensure')

Returns:

  • (Any)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'functions/ensure2service.pp', line 1

function tp::ensure2service (
  Variant[Boolean,String] $input  = present,
  Enum['ensure','enable'] $param = 'ensure',
) {
  $output = $param ? {
    'ensure' => $input ? {
      'absent'  => stopped,
      false     => stopped,
      default   => 'running',
    },
    'enable' => $input ? {
      'absent'  => false,
      false     => false,
      default   => true,
    }
  }
}