Defined Type: elasticsearch::service

Defined in:
manifests/service.pp

Overview

Class: elasticsearch::service

This class exists to coordinate all service management related actions, functionality and logical units in a central place.

Note: “service” is the Puppet term and type for background processes in general and is used in a platform-independent way. E.g. “service” means “daemon” in relation to Unix-like systems.

Parameters

ensure

String. Controls if the managed resources shall be present or absent. If set to absent:

  • The managed software packages are being uninstalled.

  • Any traces of the packages will be purged as good as possible. This may include existing configuration files. The exact behavior is provider dependent. Q.v.:

  • System modifications (if any) will be reverted as good as possible (e.g. removal of created users, services, changed log settings, …).

  • This is thus destructive and should be used with care.

Defaults to present.

status

String to define the status of the service. Possible values:

  • enabled: Service is running and will be started at boot time.

  • disabled: Service is stopped and will not be started at boot time.

  • running: Service is running but will not be started at boot time. You can use this to start a service on the first Puppet run instead of the system startup.

  • unmanaged: Service will not be started at boot time and Puppet does not care whether the service is running or not. For example, this may be useful if a cluster management software is used to decide when to start the service plus assuring it is running on the desired node.

Defaults to enabled. The singular form (“service”) is used for the sake of convenience. Of course, the defined status affects all services if more than one is managed (see service.pp to check if this is the case).

init_defaults

Defaults file content in hash representation

init_defaults_file

Defaults file as puppet resource

init_template

Service file as a template

service_flags

Service flags, used on OpenBSD for service configuration

Authors

Parameters:

  • ensure (Any) (defaults to: $elasticsearch::ensure)
  • status (Any) (defaults to: $elasticsearch::status)
  • init_defaults_file (Any) (defaults to: undef)
  • init_defaults (Any) (defaults to: undef)
  • init_template (Any) (defaults to: undef)
  • service_flags (Any) (defaults to: undef)


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'manifests/service.pp', line 60

define elasticsearch::service(
  $ensure             = $elasticsearch::ensure,
  $status             = $elasticsearch::status,
  $init_defaults_file = undef,
  $init_defaults      = undef,
  $init_template      = undef,
  $service_flags      = undef,
) {

  case $elasticsearch::real_service_provider {

    'init': {
      elasticsearch::service::init { $name:
        ensure             => $ensure,
        status             => $status,
        init_defaults_file => $init_defaults_file,
        init_defaults      => $init_defaults,
        init_template      => $init_template,
      }
    }
    'openbsd': {
      elasticsearch::service::openbsd { $name:
        ensure        => $ensure,
        status        => $status,
        init_template => $init_template,
        service_flags => $service_flags,
      }
    }
    'systemd': {
      elasticsearch::service::systemd { $name:
        ensure             => $ensure,
        status             => $status,
        init_defaults_file => $init_defaults_file,
        init_defaults      => $init_defaults,
        init_template      => $init_template,
      }
    }
    'openrc': {
      elasticsearch::service::openrc { $name:
        ensure             => $ensure,
        status             => $status,
        init_defaults_file => $init_defaults_file,
        init_defaults      => $init_defaults,
        init_template      => $init_template,
      }
    }
    default: {
      fail("Unknown service provider ${elasticsearch::real_service_provider}")
    }

  }

}