Puppet Class: opensearch

Defined in:
manifests/init.pp

Summary

Module to manage opensearch.

Overview

Parameters:

  • version (Optional[String]) (defaults to: undef) —

    The version to be installed. See also: opensearch.org/downloads.html

  • manage_package (Boolean) (defaults to: true) —

    Whether to manage the package installation.

  • package_source (Enum['archive', 'download', 'repository']) (defaults to: 'repository') —

    The source for the package.

  • package_ensure (Enum['present', 'absent']) (defaults to: 'present') —

    The status of the package.

  • package_architecture (Enum['x64', 'arm64']) —

    The architecture for the package.

  • package_provider (Enum['dpkg', 'rpm']) —

    The provider for the package to be used to install the package.

  • package_directory (Stdlib::Absolutepath) (defaults to: '/opt/opensearch') —

    The directory to install the package. Only used for package_source = ‘archive’.

  • pin_package (Boolean) (defaults to: true) —

    Whether to enable the ‘apt::pin` or `yum::versionlock` for the package.

  • apt_pin_priority (Integer) (defaults to: 1001) —

    The priority for apt::pin of the opensearch package.

  • manage_config (Boolean) (defaults to: true) —

    Whether to manage the configuration.

  • use_default_settings (Boolean) (defaults to: true) —

    Whether to use the modules default settings values.

  • default_settings (Hash) —

    The modules default settings for opensearch.

  • settings (Hash) (defaults to: {}) —

    Additional settings for opensearch.

  • use_default_notifications_notifications (Boolean) (defaults to: true) —

    Whether to use the module default notification settings

  • notifications_notifications (Hash) (defaults to: {}) —

    Additional notification settings

  • use_default_notifications_notifications_core (Boolean) (defaults to: true) —

    Whether to use the module default notification-core settings

  • notifications_notifications_core (Hash) (defaults to: {}) —

    Additional notification-core settings

  • use_default_observability_observability (Boolean) (defaults to: true) —

    Whether to use the module default observability settings

  • observability_observability (Hash) (defaults to: {}) —

    Additional observability settings

  • use_default_reporting_reports_scheduler (Boolean) (defaults to: true) —

    Whether to use the module default reports-scheduler settings

  • reporting_reports_scheduler (Hash) (defaults to: {}) —

    Additional reports-scheduler settings

  • use_default_security_action_groups (Boolean) (defaults to: true) —

    Whether to use the module default security action_groups settings

  • security_action_groups (Hash) (defaults to: {}) —

    Additional security action_groups settings

  • use_default_security_allowlist (Boolean) (defaults to: true) —

    Whether to use the module default security allowlist settings

  • security_allowlist (Hash) (defaults to: {}) —

    Additional security allowlist settings

  • use_default_security_audit (Boolean) (defaults to: true) —

    Whether to use the module default security audit settings

  • security_audit (Hash) (defaults to: {}) —

    Additional security audit settings

  • use_default_security_config (Boolean) (defaults to: true) —

    Whether to use the module default security config settings

  • security_config (Hash) (defaults to: {}) —

    Additional security config settings

  • use_default_security_internal_users (Boolean) (defaults to: true) —

    Whether to use the module default security internal_users settings

  • security_internal_users (Hash) (defaults to: {}) —

    Additional security internal_users settings

  • use_default_security_nodes_dn (Boolean) (defaults to: true) —

    Whether to use the module default security nodes_dn settings

  • security_nodes_dn (Hash) (defaults to: {}) —

    Additional security nodes_dn settings

  • use_default_security_roles_mapping (Boolean) (defaults to: true) —

    Whether to use the module default security roles_mapping settings

  • security_roles_mapping (Hash) (defaults to: {}) —

    Additional security roles_mapping settings

  • use_default_security_roles (Boolean) (defaults to: true) —

    Whether to use the module default security roles settings

  • security_roles (Hash) (defaults to: {}) —

    Additional security roles settings

  • use_default_security_tenants (Boolean) (defaults to: true) —

    Whether to use the module default security tenants settings

  • security_tenants (Hash) (defaults to: {}) —

    Additional security tenants settings

  • use_default_security_whitelist (Boolean) (defaults to: true) —

    Whether to use the module default security whitelist settings

  • security_whitelist (Hash) (defaults to: {}) —

    Additional security whitelist settings

  • heap_size (Pattern[/\d+[mg]/]) (defaults to: '512m') —

    The heap size for the JVM.

  • jvm_settings (Array[String[1]]) (defaults to: []) —

    User settings for jvm.

  • jvm_fatal_error_log (Stdlib::Absolutepath) (defaults to: '/var/log/opensearch/hs_err_pid%p.log') —

    Log path for JVM fatal error

  • default_jvm_gc_settings (Array[String[1]]) (defaults to: []) —

    Default settings for jvm gc.

  • use_default_jvm_gc_settings (Boolean) (defaults to: true) —

    Whether to use the default jvm gc settings.

  • jvm_gc_settings (Array[String[1]]) (defaults to: []) —

    User settings for jvm gc.

  • default_jvm_gc_logging_settings (Array[String[1]]) (defaults to: []) —

    Default settings for jvm gc logging.

  • use_default_jvm_gc_logging_settings (Boolean) (defaults to: true) —

    Whether to use the default jvm gc logging settings.

  • jvm_gc_logging_settings (Array[String[1]]) (defaults to: []) —

    User settings for jvm logging gc.

  • manage_service (Boolean) (defaults to: true) —

    Whether to manage the opensearch service.

  • service_ensure (Stdlib::Ensure::Service) (defaults to: 'running') —

    The state for the opensearch service.

  • service_enable (Boolean) (defaults to: true) —

    Whether to enable the service.

  • restart_on_config_change (Boolean) (defaults to: true) —

    Restart the service on any config changes

  • restart_on_package_change (Boolean) (defaults to: true) —

    Restart the service on package changes

  • manage_repository (Boolean) (defaults to: true)
  • repository_ensure (Enum['present', 'absent']) (defaults to: 'present')
  • repository_location (Optional[Stdlib::HTTPUrl]) (defaults to: undef)
  • repository_gpg_key (Optional[Stdlib::HTTPUrl]) (defaults to: undef)
  • heap_dump_on_oom (Boolean) (defaults to: true)


119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'manifests/init.pp', line 119

class opensearch (
  Enum['x64', 'arm64']                      $package_architecture,
  Enum['dpkg', 'rpm']                       $package_provider,
  Hash                                      $default_settings,

  ##
  ## version
  ##
  Optional[String]                          $version                                      = undef,

  ##
  ## package values
  ##
  Boolean                                   $manage_package                               = true,
  Stdlib::Absolutepath                      $package_directory                            = '/opt/opensearch',
  Enum['present', 'absent']                 $package_ensure                               = 'present',
  Enum['archive', 'download', 'repository'] $package_source                               = 'repository',
  Boolean                                   $pin_package                                  = true,
  Integer                                   $apt_pin_priority                             = 1001,

  ##
  ## repository
  ##
  Boolean                                   $manage_repository                            = true,
  Enum['present', 'absent']                 $repository_ensure                            = 'present',
  Optional[Stdlib::HTTPUrl]                 $repository_location                          = undef,
  Optional[Stdlib::HTTPUrl]                 $repository_gpg_key                           = undef,

  ##
  ## opensearch settings
  ##
  Boolean                                   $manage_config                                = true,
  Boolean                                   $use_default_settings                         = true,
  Hash                                      $settings                                     = {},

  Boolean                                   $use_default_notifications_notifications      = true,
  Hash                                      $notifications_notifications                  = {},

  Boolean                                   $use_default_notifications_notifications_core = true,
  Hash                                      $notifications_notifications_core             = {},

  Boolean                                   $use_default_observability_observability      = true,
  Hash                                      $observability_observability                  = {},

  Boolean                                   $use_default_reporting_reports_scheduler      = true,
  Hash                                      $reporting_reports_scheduler                  = {},

  Boolean                                   $use_default_security_action_groups           = true,
  Hash                                      $security_action_groups                       = {},
  Boolean                                   $use_default_security_allowlist               = true,
  Hash                                      $security_allowlist                           = {},
  Boolean                                   $use_default_security_audit                   = true,
  Hash                                      $security_audit                               = {},
  Boolean                                   $use_default_security_config                  = true,
  Hash                                      $security_config                              = {},
  Boolean                                   $use_default_security_internal_users          = true,
  Hash                                      $security_internal_users                      = {},
  Boolean                                   $use_default_security_nodes_dn                = true,
  Hash                                      $security_nodes_dn                            = {},
  Boolean                                   $use_default_security_roles_mapping           = true,
  Hash                                      $security_roles_mapping                       = {},
  Boolean                                   $use_default_security_roles                   = true,
  Hash                                      $security_roles                               = {},
  Boolean                                   $use_default_security_tenants                 = true,
  Hash                                      $security_tenants                             = {},
  Boolean                                   $use_default_security_whitelist               = true,
  Hash                                      $security_whitelist                           = {},

  ##
  ## java settings
  ##
  Pattern[/\d+[mg]/]                        $heap_size                                    = '512m',
  Boolean                                   $heap_dump_on_oom                             = true,
  Array[String[1]]                          $jvm_settings                                 = [],
  Stdlib::Absolutepath                      $jvm_fatal_error_log                          = '/var/log/opensearch/hs_err_pid%p.log',
  Array[String[1]]                          $default_jvm_gc_settings                      = [],
  Boolean                                   $use_default_jvm_gc_settings                  = true,
  Array[String[1]]                          $jvm_gc_settings                              = [],
  Array[String[1]]                          $default_jvm_gc_logging_settings              = [],
  Boolean                                   $use_default_jvm_gc_logging_settings          = true,
  Array[String[1]]                          $jvm_gc_logging_settings                      = [],

  ##
  ## service values
  ##
  Boolean                                   $manage_service                               = true,
  Stdlib::Ensure::Service                   $service_ensure                               = 'running',
  Boolean                                   $service_enable                               = true,
  Boolean                                   $restart_on_config_change                     = true,
  Boolean                                   $restart_on_package_change                    = true,
) {
  # the default opensearch version is still 2. latest/supported is 3
  # both have different gpg keys
  # users can also provide their own key
  $default_key = if $version and versioncmp($version, '3') >= 0 {
    'puppet:///modules/opensearch/opensearch-3.asc'
  } else {
    'puppet:///modules/opensearch/opensearch-2.asc'
  }
  $real_repository_gpg_key = pick($repository_gpg_key, $default_key)

  contain opensearch::install
  contain opensearch::config
  contain opensearch::service

  Class['opensearch::install'] -> Class['opensearch::config'] -> Class['opensearch::service']

  if $restart_on_package_change {
    Class['opensearch::install'] ~> Class['opensearch::service']
  }

  if $restart_on_config_change {
    Class['opensearch::config'] ~> Class['opensearch::service']
  }
}