Defined Type: nuodb::manager::domain_administrator
- Defined in:
- manifests/manager/domain_administrator.pp
Overview
Define: nuodb::manager::domain_administrator
This type allows creating and deleting a domain administrator. Note that the domain administrator password changes will not be reflected after the domain administrator has been created once.
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 |
# File 'manifests/manager/domain_administrator.pp', line 32
define nuodb::manager::domain_administrator (
$ensure = 'present',
$nuodb_home = $::nuodb::nuodb_home,
$broker_host = $::nuodb::default_properties['altAddr'],
$domain_password = $::nuodb::default_properties['domainPassword'],
$username = $title,
$password = $title,
) {
validate_re($ensure, '^(present|absent)$', "${ensure} is not supported. Allowed values are 'present' and 'absent'.")
$base_command = "${nuodb_home}/bin/nuodbmgr --broker '${broker_host}' --password '${domain_password}' --command"
$exists_check = "${base_command} \"show domain administrators\" | grep -q -Fx '${username}'"
if ($ensure == 'present') {
exec { "create-domain-administrator-${username}" :
command => "${base_command} \"create domain administrator user '${username}' password '${password}'\"",
unless => $exists_check,
}
} else {
exec { "remove-domain-administrator-${username}" :
command => "${base_command} \"remove domain administrator user '${username}'\"",
onlyif => $exists_check,
}
}
}
|