Defined Type: elasticsearch::service

Defined in:
manifests/service.pp

Overview

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) (defaults to: $elasticsearch::ensure)

    Controls if the managed resources shall be ‘present` or `absent`. If set to `absent`, the managed software packages will be uninstalled, and any traces of the packages will be purged as well as possible, possibly including existing configuration files. System modifications (if any) will be reverted as well as possible (e.g. removal of created users, services, changed log settings, and so on). This is a destructive parameter and should be used with care.

  • init_defaults (Hash) (defaults to: undef)

    Defaults file content in hash representation

  • init_defaults_file (String) (defaults to: undef)

    Defaults file as puppet resource

  • init_template (String) (defaults to: undef)

    Service file as a template

  • service_flags (String) (defaults to: undef)

    Flags to pass to the service.

  • status (String) (defaults to: $elasticsearch::status)

    Defines the status of the service. If set to ‘enabled`, the service is started and will be enabled at boot time. If set to `disabled`, the service is stopped and will not be started at boot time. If set to `running`, the service is started but will not be enabled at boot time. You may use this to start a service on the first Puppet run instead of the system startup. If set to `unmanaged`, the 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.

Author:

  • Richard Pijnenburg <richard.pijnenburg@elasticsearch.com>

  • Tyler Langlois <tyler.langlois@elastic.co>



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
# File 'manifests/service.pp', line 43

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

  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}")
    }

  }

}