Puppet Class: opensearch_dashboards

Defined in:
manifests/init.pp

Summary

Module to manage OpensSearch Dashboards

Overview

Parameters:

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

    The version to be installed

  • manage_package (Boolean) (defaults to: true)

    Whether to manage the package installation

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

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

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

    The status of the package

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

    The source for the package

  • 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-dashboards package

  • manage_repository (Boolean) (defaults to: true)

    Whether to manage the package repository

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

    The status of the repository

  • repository_location (Optional[Stdlib::HTTPUrl]) (defaults to: undef)

    The location of the repository

  • repository_gpg_key (Stdlib::HTTPUrl) (defaults to: 'https://artifacts.opensearch.org/publickeys/opensearch.pgp')

    The GnuPG key of the repository

  • manage_config (Boolean) (defaults to: true)

    Whether to manage the configuration

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

    Custom settings for OpenSearch Dashboards

  • manage_service (Boolean) (defaults to: true)

    Whether to manage the opensearch-dashboards service

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

    The state for the opensearch-dashboards 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



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
# File 'manifests/init.pp', line 27

class opensearch_dashboards (
  ##
  ## version
  ##
  Optional[String]                          $version                   = undef,

  ##
  ## package
  ##
  Boolean                                   $manage_package            = true,
  Stdlib::Absolutepath                      $package_directory         = '/opt/opensearch-dashboards',
  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,
  Stdlib::HTTPUrl                           $repository_gpg_key        = 'https://artifacts.opensearch.org/publickeys/opensearch.pgp',

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

  ##
  ## service
  ##
  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,
) {
  $package_architecture = fact('os.hardware') ? {
    'amd64'  => 'x64',
    'arm64'  => 'arm64',
    'x64'    => 'x64',
    'x86_64' => 'x64',
  }
  $package_provider = fact('os.family') ? {
    'Debian' => 'dpkg',
    'RedHat' => 'rpm',
  }

  contain opensearch_dashboards::install
  contain opensearch_dashboards::config
  contain opensearch_dashboards::service

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

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

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