Defined Type: nut::user

Defined in:
manifests/user.pp

Overview

Configure a user for UPS access.

Examples:

Declaring a user

include ::nut
::nut::user { 'test':
  password => 'password',
}

Declaring a upsmon user

include ::nut
::nut::user { 'monmaster':
  password => 'secret',
  upsmon   => 'master',
}

Parameters:

  • password (String)

    The password for the user.

  • actions (Optional[Array[String, 1]]) (defaults to: undef)

    List of actions to permit the user to do.

  • instcmds (Optional[Array[String, 1]]) (defaults to: undef)

    List of instant commands the user can initiate.

  • upsmon (Optional[Enum['master', 'slave']]) (defaults to: undef)

    Set the user to be used by upsmon.

  • user (String) (defaults to: $title)

    The name of the user.

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'manifests/user.pp', line 24

define nut::user (
  String                            $password,
  Optional[Array[String, 1]]        $actions  = undef,
  Optional[Array[String, 1]]        $instcmds = undef,
  Optional[Enum['master', 'slave']] $upsmon   = undef,
  String                            $user     = $title,
) {

  if ! defined(Class['nut']) {
    fail('You must include the nut base class before using any nut defined resources')
  }

  ::concat::fragment { "nut user ${user}":
    content => template('nut/upsd.users.erb'),
    target  => "${::nut::conf_dir}/upsd.users",
  }
}