-
-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update JVM startup options - Add node name to log4j2.properties - Rename augeas resource to prevent dependency loop - Add boolean to enable/disable xpack and required features - Add self to contributors list - Add check for required certificate variables - Add version check for xpack related settings Maintains backwards compatibility - Resolve variable scope warnings - Update unit tests - Remove ubuntu 14.04 acceptance tests - Not supported https://www.elastic.co/support/matrix
- Loading branch information
1 parent
725afd6
commit 847e7a2
Showing
11 changed files
with
118 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,6 +297,9 @@ | |
# @param version | ||
# To set the specific version you want to install. | ||
# | ||
# @param xpack | ||
# Enable x-pack security. Requires ca_certificate, certificate and private key. | ||
# | ||
# @author Richard Pijnenburg <[email protected]> | ||
# @author Tyler Langlois <[email protected]> | ||
# | ||
|
@@ -371,6 +374,7 @@ | |
Hash $users, | ||
Boolean $validate_tls, | ||
Variant[String, Boolean] $version, | ||
Boolean $xpack, | ||
Boolean $restart_config_change = $restart_on_change, | ||
Boolean $restart_package_change = $restart_on_change, | ||
Boolean $restart_plugin_change = $restart_on_change, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,9 @@ | |
# Source for the Shield system key. Valid values are any that are | ||
# supported for the file resource `source` parameter. | ||
# | ||
# @param xpack | ||
# Enable xpack security features. Requires ca_certificate, certificate and private_key. | ||
# | ||
# @author Richard Pijnenburg <[email protected]> | ||
# @author Tyler Langlois <[email protected]> | ||
# | ||
|
@@ -162,6 +165,7 @@ | |
Boolean $ssl = false, | ||
Elasticsearch::Status $status = $elasticsearch::status, | ||
Optional[String] $system_key = $elasticsearch::system_key, | ||
Boolean $xpack = $elasticsearch::xpack, | ||
) { | ||
|
||
File { | ||
|
@@ -273,6 +277,10 @@ | |
fail('keystore_password required') | ||
} | ||
|
||
if (($ca_certificate == undef) or ($certificate == undef) or ($private_key == undef)) { | ||
fail('ca_certificate, certificate and private_key required') | ||
} | ||
|
||
if ($keystore_path == undef) { | ||
$_keystore_path = "${configdir}/${security_plugin}/${name}.ks" | ||
} else { | ||
|
@@ -287,11 +295,23 @@ | |
'shield.ssl.keystore.password' => $keystore_password, | ||
} | ||
} elsif $security_plugin == 'x-pack' { | ||
$tls_config = { | ||
'xpack.security.transport.ssl.enabled' => true, | ||
'xpack.security.http.ssl.enabled' => true, | ||
'xpack.ssl.keystore.path' => $_keystore_path, | ||
'xpack.ssl.keystore.password' => $keystore_password, | ||
if $elasticsearch::version.split(/\./)[0] == '7' { | ||
$tls_config = { | ||
'xpack.security.transport.ssl.enabled' => true, | ||
'xpack.security.transport.ssl.keystore.path' => $_keystore_path, | ||
'xpack.security.transport.ssl.keystore.password' => $keystore_password, | ||
'xpack.security.http.ssl.enabled' => true, | ||
'xpack.security.http.ssl.keystore.path' => $_keystore_path, | ||
'xpack.security.http.ssl.keystore.password' => $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' => $keystore_password, | ||
} | ||
} | ||
} | ||
|
||
|
@@ -440,13 +460,51 @@ | |
} | ||
} | ||
|
||
if $xpack { | ||
if (($ca_certificate == undef) or ($certificate == undef) or ($private_key == undef)) { | ||
fail('ca_certificate, certificate and private_key required') | ||
} | ||
|
||
file { "${configdir}/ca_certificate.pem": | ||
ensure => 'file', | ||
source => "file://${ca_certificate}", | ||
owner => $elasticsearch::elasticsearch_user, | ||
group => undef, | ||
mode => '0640', | ||
} | ||
file { "${configdir}/certificate.pem": | ||
ensure => 'file', | ||
source => "file://${certificate}", | ||
owner => $elasticsearch::elasticsearch_user, | ||
group => undef, | ||
mode => '0640', | ||
} | ||
file { "${configdir}/private_key.key": | ||
ensure => 'file', | ||
source => "file://${private_key}", | ||
owner => $elasticsearch::elasticsearch_user, | ||
group => undef, | ||
mode => '0600', | ||
} | ||
|
||
$xpack_config = { | ||
'xpack.security.enabled' => true, | ||
'xpack.security.transport.ssl.enabled' => true, | ||
'xpack.security.transport.ssl.verification_mode' => 'certificate', | ||
'xpack.security.transport.ssl.key' => "${configdir}/private_key.key", | ||
'xpack.security.transport.ssl.certificate' => "${configdir}/certificate.pem", | ||
'xpack.security.transport.ssl.certificate_authorities' => "${configdir}/ca_certificate.pem", | ||
} | ||
} else { $xpack_config = {} } | ||
|
||
# build up new config | ||
$instance_conf = merge( | ||
$main_config, | ||
$instance_node_name, | ||
$instance_datadir_config, | ||
{ 'path.logs' => $logdir }, | ||
$tls_config, | ||
$xpack_config, | ||
$instance_config | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters