Skip to content

Commit

Permalink
Set xpack config to enable authentication using username and password
Browse files Browse the repository at this point in the history
  • Loading branch information
miluxhd authored and milad-24 committed Sep 10, 2024
1 parent 543c582 commit 416a2d5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ The following parameters are available in the `elasticsearch` class:
* [`users`](#-elasticsearch--users)
* [`validate_tls`](#-elasticsearch--validate_tls)
* [`version`](#-elasticsearch--version)
* [`password_enabled`](#-elasticsearch--password_enabled)

##### <a name="-elasticsearch--ensure"></a>`ensure`

Expand Down Expand Up @@ -805,6 +806,14 @@ Data type: `Variant[String, Boolean]`

To set the specific version you want to install.

##### <a name="-elasticsearch--password_enabled"></a>`password_enabled`

Data type: `Boolean`

To enable or disable password authentication.

Default value: `false`

### <a name="elasticsearch--config"></a>`elasticsearch::config`

This class exists to coordinate all configuration related actions,
Expand Down
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <richard.pijnenburg@elasticsearch.com>
# @author Tyler Langlois <tyler.langlois@elastic.co>
# @author Gavin Williams <gavin.williams@elastic.co>
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 416a2d5

Please sign in to comment.