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.

Examples:

class { '::nuodb' :
  domain_administrators => {
    'testadmin1' => {
      ensure   => present,
      password => 'secret1',
    },
  },
}
::nuodb::manager::domain_administrator { 'testadmin1':
  ensure   => present,
  password => 'secret1',
}

Parameters:

  • ensure (Any) (defaults to: 'present')

    the ensure value to determine if the domain administrator should be present or absent. Defaults to present.

  • nuodb_home (Any) (defaults to: $::nuodb::nuodb_home)

    the directory where NuoDB is installed to. Defaults to the install location from the module.

  • broker_host (Any) (defaults to: $::nuodb::default_properties['altAddr'])

    the host name for the broker instance to connect to create the domain administrator. Defaults to the ‘altAddr’ property set for the default.properties in the module parameters.

  • domain_password (Any) (defaults to: $::nuodb::default_properties['domainPassword'])

    domain password to use for authenticating with the broker. Defaults to the ‘domainPassword’ property set for the default.properties in the module parameters.

  • username (Any) (defaults to: $title)

    Domain administrator username for the domain. Defaults to the title.

  • password (Any) (defaults to: $title)

    Domain administrator password for the domain. Defaults to the title.



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,
    }
  }
}