Defined Type: elasticsearch::role
- Defined in:
- manifests/role.pp
Overview
Manage x-pack roles.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'manifests/role.pp', line 30
define elasticsearch::role (
Enum['absent', 'present'] $ensure = 'present',
Array $mappings = [],
Hash $privileges = {},
) {
#validate_slength($name, 40, 1)
if ($name.length < 1 or $name.length > 40) {
fail("Invalid length role name '${name}' must be between 1 and 40")
}
if empty($privileges) or $ensure == 'absent' {
$_role_ensure = 'absent'
} else {
$_role_ensure = $ensure
}
if empty($mappings) or $ensure == 'absent' {
$_mapping_ensure = 'absent'
} else {
$_mapping_ensure = $ensure
}
elasticsearch_role { $name :
ensure => $_role_ensure,
privileges => $privileges,
}
elasticsearch_role_mapping { $name :
ensure => $_mapping_ensure,
mappings => $mappings,
}
}
|