|
181 | 181 | mode => '0440',
|
182 | 182 | }
|
183 | 183 |
|
184 |
| - if ($elasticsearch::version != false and versioncmp($elasticsearch::version, '7.7.0') >= 0) { |
| 184 | + file { "${elasticsearch::configdir}/jvm.options": |
| 185 | + ensure => 'file', |
| 186 | + notify => $elasticsearch::_notify_service, |
| 187 | + require => Class['elasticsearch::package'], |
| 188 | + owner => 'root', |
| 189 | + group => $elasticsearch::elasticsearch_group, |
| 190 | + mode => '0640', |
| 191 | + } |
| 192 | + |
| 193 | + if ($elasticsearch::version != false and versioncmp($elasticsearch::version, '7.7.0') < 0) { |
| 194 | + # Add any additional JVM options |
| 195 | + $elasticsearch::jvm_options.each |String $jvm_option| { |
| 196 | + $split_jvm_option = split($jvm_option, '=') |
| 197 | + file_line { "jvm_option_${jvm_option}": |
| 198 | + ensure => present, |
| 199 | + path => "${elasticsearch::configdir}/jvm.options", |
| 200 | + match => $split_jvm_option.length ? { 2 => "^${split_jvm_option[0]}=", default => undef, }, |
| 201 | + line => $jvm_option, |
| 202 | + notify => $elasticsearch::_notify_service, |
| 203 | + } |
| 204 | + } |
| 205 | + } |
| 206 | + else { |
185 | 207 | # https://www.elastic.co/guide/en/elasticsearch/reference/master/advanced-configuration.html#set-jvm-options
|
186 | 208 | # https://github.com/elastic/elasticsearch/pull/51882
|
187 | 209 | # >> "Do not modify the root jvm.options file. Use files in jvm.options.d/ instead."
|
|
197 | 219 | notify => $elasticsearch::_notify_service,
|
198 | 220 | }
|
199 | 221 | }
|
200 |
| - else { |
201 |
| - # Add any additional JVM options |
202 |
| - $elasticsearch::jvm_options.each |String $jvm_option| { |
203 |
| - $split_jvm_option = split($jvm_option, '=') |
204 |
| - file_line { "jvm_option_${jvm_option}": |
205 |
| - ensure => present, |
206 |
| - path => "${elasticsearch::configdir}/jvm.options", |
207 |
| - match => $split_jvm_option.length ? { 2 => "^${split_jvm_option[0]}=", default => undef, }, |
208 |
| - line => $jvm_option, |
209 |
| - notify => $elasticsearch::_notify_service, |
210 |
| - } |
211 |
| - } |
212 |
| - } |
213 | 222 |
|
214 | 223 | if $elasticsearch::system_key != undef {
|
215 | 224 | file { "${elasticsearch::configdir}/system_key":
|
|
0 commit comments