Skip to content

Commit fca60fe

Browse files
author
Gavin Williams
committed
Set correct config keys for Xpack security in Elasticsearch 7
1 parent 86b4fb7 commit fca60fe

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

manifests/config.pp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,24 @@
9797
$_keystore_path = $elasticsearch::keystore_path
9898
}
9999

100-
$_tls_config = {
101-
'xpack.security.transport.ssl.enabled' => true,
102-
'xpack.security.http.ssl.enabled' => true,
103-
'xpack.ssl.keystore.path' => $_keystore_path,
104-
'xpack.ssl.keystore.password' => $elasticsearch::keystore_password,
100+
# Set the correct xpack. settings based on ES version
101+
if (versioncmp($elasticsearch::version, '7') >= 0) {
102+
$_tls_config = {
103+
'xpack.security.http.ssl.enabled' => true,
104+
'xpack.security.http.ssl.keystore.path' => $_keystore_path,
105+
'xpack.security.http.ssl.keystore.password' => $elasticsearch::keystore_password,
106+
'xpack.security.transport.ssl.enabled' => true,
107+
'xpack.security.transport.ssl.keystore.path' => $_keystore_path,
108+
'xpack.security.transport.ssl.keystore.password' => $elasticsearch::keystore_password,
109+
}
110+
}
111+
else {
112+
$_tls_config = {
113+
'xpack.security.transport.ssl.enabled' => true,
114+
'xpack.security.http.ssl.enabled' => true,
115+
'xpack.ssl.keystore.path' => $_keystore_path,
116+
'xpack.ssl.keystore.password' => $elasticsearch::keystore_password,
117+
}
105118
}
106119

107120
# Trust CA Certificate

0 commit comments

Comments
 (0)