Skip to content

Commit c5072d8

Browse files
author
Gavin Williams
committed
Fix role and user manifests
1 parent d28bc38 commit c5072d8

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

‎manifests/role.pp‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Manage shield/x-pack roles.
1+
# Manage x-pack roles.
22
#
33
# @param ensure
44
# Whether the role should be present or not.
@@ -9,7 +9,7 @@
99
#
1010
# @param privileges
1111
# A hash of permissions defined for the role. Valid privilege settings can
12-
# be found in the Shield/x-pack documentation.
12+
# be found in the x-pack documentation.
1313
#
1414
# @example create and manage the role 'power_user' mapped to an LDAP group.
1515
# elasticsearch::role { 'power_user':
@@ -25,16 +25,14 @@
2525
# }
2626
#
2727
# @author Tyler Langlois <tyler.langlois@elastic.co>
28+
# @author Gavin Williams <gavin.williams@elastic.co>
2829
#
2930
define elasticsearch::role (
3031
Enum['absent', 'present'] $ensure = 'present',
3132
Array $mappings = [],
3233
Hash $privileges = {},
3334
) {
3435
validate_slength($name, 30, 1)
35-
if $elasticsearch::security_plugin == undef {
36-
fail("\"${elasticsearch::security_plugin}\" required")
37-
}
3836

3937
if empty($privileges) or $ensure == 'absent' {
4038
$_role_ensure = 'absent'

‎manifests/user.pp‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Manages shield/x-pack users.
1+
# Manages x-pack users.
22
#
33
# @example creates and manage a user with membership in the 'logstash' and 'kibana4' roles.
44
# elasticsearch::user { 'bob':
@@ -20,16 +20,13 @@
2020
# A list of roles to which the user should belong.
2121
#
2222
# @author Tyler Langlois <tyler.langlois@elastic.co>
23+
# @author Gavin Williams <gavin.williams@elastic.co>
2324
#
2425
define elasticsearch::user (
2526
String $password,
2627
Enum['absent', 'present'] $ensure = 'present',
2728
Array $roles = [],
2829
) {
29-
if $elasticsearch::security_plugin == undef {
30-
fail("\"${elasticsearch::security_plugin}\" required")
31-
}
32-
3330
if $password =~ /^\$2a\$/ {
3431
elasticsearch_user_file { $name:
3532
ensure => $ensure,

0 commit comments

Comments
 (0)