From 9c57332462be6ab011e9fc513a71168b1bd8682b Mon Sep 17 00:00:00 2001 From: Milad Zangeneh Date: Tue, 10 Sep 2024 17:32:33 +0200 Subject: [PATCH] Set xpack config to enable authentication using username and password --- manifests/config.pp | 2 +- manifests/init.pp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 9aeb2cb10..2181113b5 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -165,7 +165,7 @@ # Generate Elasticsearch config $data = - $elasticsearch::config + { 'path.data' => $elasticsearch::datadir } + { 'path.logs' => $elasticsearch::logdir } + $_tls_config + $elasticsearch::config + { 'path.data' => $elasticsearch::datadir } + { 'path.logs' => $elasticsearch::logdir } + { 'xpack.security.enabled' => $elasticsearch::password_enabled } + $_tls_config file { "${elasticsearch::configdir}/elasticsearch.yml": ensure => 'file', diff --git a/manifests/init.pp b/manifests/init.pp index e97ad1217..ac03d9e2a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -343,6 +343,9 @@ # @param version # To set the specific version you want to install. # +# @param password_enabled +# To enable or disable password authentication. +# # @author Richard Pijnenburg # @author Tyler Langlois # @author Gavin Williams @@ -436,6 +439,7 @@ Boolean $restart_package_change = $restart_on_change, Boolean $restart_plugin_change = $restart_on_change, Stdlib::Filemode $logdir_mode = '2750', + Boolean $password_enabled = false ) { #### Validate parameters