Skip to content

Commit

Permalink
Set defaults to ES7+
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper Aikema committed Feb 9, 2024
1 parent 3c78e18 commit b3e2725
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,15 @@
}

# Set the correct xpack. settings based on ES version
if ($elasticsearch::version != false and versioncmp($elasticsearch::version, '7') >= 0) {
if ($elasticsearch::version != false and versioncmp($elasticsearch::version, '7') < 0) {
$_tls_config = {
'xpack.security.transport.ssl.enabled' => true,
'xpack.security.http.ssl.enabled' => true,
'xpack.ssl.keystore.path' => $_keystore_path,
'xpack.ssl.keystore.password' => $elasticsearch::keystore_password,
}
}
else {
$_tls_config = {
'xpack.security.http.ssl.enabled' => true,
'xpack.security.http.ssl.keystore.path' => $_keystore_path,
Expand All @@ -110,14 +118,6 @@
'xpack.security.transport.ssl.keystore.password' => $elasticsearch::keystore_password,
}
}
else {
$_tls_config = {
'xpack.security.transport.ssl.enabled' => true,
'xpack.security.http.ssl.enabled' => true,
'xpack.ssl.keystore.path' => $_keystore_path,
'xpack.ssl.keystore.password' => $elasticsearch::keystore_password,
}
}

# Trust CA Certificate
java_ks { 'elasticsearch_ca':
Expand Down Expand Up @@ -181,7 +181,7 @@
mode => '0440',
}

if ($elasticsearch::version != false and versioncmp($elasticsearch::version, '7.7.0') >= 0) {
if ($elasticsearch::version == false or versioncmp($elasticsearch::version, '7.7.0') >= 0) {
# https://www.elastic.co/guide/en/elasticsearch/reference/master/advanced-configuration.html#set-jvm-options
# https://github.com/elastic/elasticsearch/pull/51882
# >> "Do not modify the root jvm.options file. Use files in jvm.options.d/ instead."
Expand Down

0 comments on commit b3e2725

Please sign in to comment.