Puppet Class: opensearch::config

Defined in:
manifests/config.pp

Summary

Configure opensearch.

Overview



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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
# File 'manifests/config.pp', line 6

class opensearch::config {
  assert_private()

  if $opensearch::manage_config {
    $config_directory = $opensearch::package_source ? {
      'archive' => "${opensearch::package_directory}/config",
      default   => '/etc/opensearch',
    }

    $settings = $opensearch::use_default_settings ? {
      true  => $opensearch::default_settings + $opensearch::settings,
      false => $opensearch::settings,
    }

    $notifications_notifications = $opensearch::use_default_notifications_notifications ? {
      true  => lookup('opensearch::default_notifications_notifications', Hash) + $opensearch::notifications_notifications,
      false => $opensearch::notifications_notifications,
    }

    $notifications_notifications_core = $opensearch::use_default_notifications_notifications_core ? {
      true  => lookup('opensearch::default_notifications_notifications_core', Hash) + $opensearch::notifications_notifications_core,
      false => $opensearch::notifications_notifications_core,
    }

    $observability_observability = $opensearch::use_default_observability_observability ? {
      true  => lookup('opensearch::default_observability_observability', Hash) + $opensearch::observability_observability,
      false => $opensearch::observability_observability,
    }

    $reporting_reports_scheduler = $opensearch::use_default_reporting_reports_scheduler ? {
      true  => lookup('opensearch::default_reporting_reports_scheduler', Hash) + $opensearch::reporting_reports_scheduler,
      false => $opensearch::reporting_reports_scheduler,
    }

    $security_action_groups = $opensearch::use_default_security_action_groups ? {
      true  => lookup('opensearch::default_security_action_groups', Hash) + $opensearch::security_action_groups,
      false => $opensearch::security_action_groups,
    }

    $security_allowlist = $opensearch::use_default_security_allowlist ? {
      true  => lookup('opensearch::default_security_allowlist', Hash) + $opensearch::security_allowlist,
      false => $opensearch::security_allowlist,
    }

    $security_audit = $opensearch::use_default_security_audit ? {
      true  => lookup('opensearch::default_security_audit', Hash) + $opensearch::security_audit,
      false => $opensearch::security_audit,
    }

    $security_config = $opensearch::use_default_security_config ? {
      true  => lookup('opensearch::default_security_config', Hash) + $opensearch::security_config,
      false => $opensearch::security_config,
    }

    $security_internal_users = $opensearch::use_default_security_internal_users ? {
      true  => lookup('opensearch::default_security_internal_users', Hash) + $opensearch::security_internal_users,
      false => $opensearch::security_internal_users,
    }

    $security_nodes_dn = $opensearch::use_default_security_nodes_dn ? {
      true  => lookup('opensearch::default_security_nodes_dn', Hash) + $opensearch::security_nodes_dn,
      false => $opensearch::security_nodes_dn,
    }

    $security_roles_mapping = $opensearch::use_default_security_roles_mapping ? {
      true  => lookup('opensearch::default_security_roles_mapping', Hash) + $opensearch::security_roles_mapping,
      false => $opensearch::security_roles_mapping,
    }

    $security_roles = $opensearch::use_default_security_roles ? {
      true  => lookup('opensearch::default_security_roles', Hash) + $opensearch::security_roles,
      false => $opensearch::security_roles,
    }

    $security_tenants = $opensearch::use_default_security_tenants ? {
      true  => lookup('opensearch::default_security_tenants', Hash) + $opensearch::security_tenants,
      false => $opensearch::security_tenants,
    }

    $security_whitelist = $opensearch::use_default_security_whitelist ? {
      true  => lookup('opensearch::default_security_whitelist', Hash) + $opensearch::security_whitelist,
      false => $opensearch::security_whitelist,
    }

    file { "${config_directory}/opensearch.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $settings.stdlib::to_yaml,
    }

    file { "${config_directory}/jvm.options":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => epp("${module_name}/jvm.options.epp"),
    }

    file { "${config_directory}/opensearch-notifications/notifications.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $notifications_notifications.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-notifications-core/notifications-core.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $notifications_notifications_core.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-reports-scheduler/reports-scheduler.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $reporting_reports_scheduler.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/action_groups.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_action_groups.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/allowlist.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_allowlist.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/audit.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_audit.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/config.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_config.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/internal_users.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_internal_users.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/nodes_dn.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_nodes_dn.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/roles_mapping.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_roles_mapping.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/roles.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_roles.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/tenants.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_tenants.stdlib::to_yaml,
    }

    file { "${config_directory}/opensearch-security/whitelist.yml":
      ensure  => file,
      owner   => 'opensearch',
      group   => 'opensearch',
      mode    => '0640',
      content => $security_whitelist.stdlib::to_yaml,
    }
  }
}