Puppet Function: wmflib::service::probe::module_options

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

Overview

wmflib::service::probe::module_options(String $service_name, Wmflib::Service $service_config)Hash

TODO support options for more than one probe if/when needed

Parameters:

  • service_name (String)
  • service_config (Wmflib::Service)

Returns:

  • (Hash)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'modules/wmflib/functions/service/probe/module_options.pp', line 4

function wmflib::service::probe::module_options(
  String $service_name,
  Wmflib::Service $service_config,
) >> Hash {

  if 'probes' in $service_config {
    $probe = $service_config['probes'][0]
  } else {
    $probe = {}
  }

  $timeout = {
    timeout => pick($probe['timeout'], '3s')
  }

  # Use 'return deep_merge(...)' with more than one hash
  return $timeout
}