Puppet Function: psick::ensure2service

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

Overview

psick::ensure2service(Psick::Ensure $ensure = 'present', Enum['ensure','enable'] $param = 'ensure')Any

Parameters:

  • ensure (Psick::Ensure) (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
18
19
20
21
22
# File 'functions/ensure2service.pp', line 1

function psick::ensure2service (
  Psick::Ensure $ensure = 'present',
  Enum['ensure','enable'] $param  = 'ensure',
) {
  case $param {
    'ensure': {
      $output = $ensure ? {
        'absent'  => 'stopped',
        false     => 'stopped',
        default   => 'running',
      }
    }
    'enable': {
      $output = $ensure ? {
        'absent'  => false,
        false     => false,
        default   => true,
      }
    }
    default: {}
  }
}