Puppet Class: nut::client

Inherits:
nut::params
Defined in:
manifests/client.pp

Overview

Installs the Network UPS Tools (NUT) client.

Examples:

Declaring the class

include ::nut::client

Using upssched for notifications

class { '::nut::client':
  use_upssched => true,
}

Parameters:

  • certident (Optional[Tuple[String, String]]) (defaults to: undef)

    Tuple of certificate name and NSS database password.

  • certpath (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Path to NSS certificate database.

  • certverify (Optional[Boolean]) (defaults to: undef)

    Verify any TLS connections.

  • cmdscript (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    The script invoked by upssched when a timer expires.

  • conf_dir (Stdlib::Absolutepath) (defaults to: $::nut::params::conf_dir)

    Top-level configuration directory, usually /etc/nut or /etc/ups.

  • deadtime (Optional[Integer[0]]) (defaults to: undef)

    How long a UPS can go without reporting anything before being declared dead.

  • finaldelay (Optional[Integer[0]]) (defaults to: undef)

    How long to wait after warning users before shutting the host down.

  • forcessl (Optional[Boolean]) (defaults to: undef)

    Always use TLS connections.

  • group (String) (defaults to: $::nut::params::group)

    The unprivileged group used to drop root privileges.

  • hostsync (Optional[Integer[0]]) (defaults to: undef)

    Wait this long for slave hosts to disconnect in a shutdown situation.

  • minsupplies (Integer[1]) (defaults to: 1)

    The number of power supplies receiving power for the host to remain powered on.

  • nocommwarntime (Optional[Integer[0]]) (defaults to: undef)

    How oftern to warn when no configured UPS is reachable.

  • notifycmd (Optional[Stdlib::Absolutepath]) (defaults to: $use_upssched)

    The command to invoke for UPS events.

  • notifyflag (Optional[Hash[Nut::Event, Tuple[Boolean, 3, 3]]]) (defaults to: undef)

    Hash of UPS event to tuple of three booleans representing using Syslog, wall(1) and $notifycmd for notifications.

  • notifymsg (Optional[Hash[Nut::Event, String]]) (defaults to: undef)

    Hash of UPS event to string for overriding the message for that event.

  • package_name (String) (defaults to: $::nut::params::client_package_name)

    The name of the package.

  • pollfreq (Optional[Integer[0]]) (defaults to: undef)

    How often to poll a UPS.

  • pollfreqalert (Optional[Integer[0]]) (defaults to: undef)

    How often to poll a UPS running on battery.

  • rbwarntime (Optional[Integer[0]]) (defaults to: undef)

    How often to warn a UPS needs a replacement battery.

  • service_name (String) (defaults to: $::nut::params::client_service_name)

    The name of the service.

  • shutdowncmd (String) (defaults to: $::nut::params::shutdown_command)

    The command used to power the host off.

  • state_dir (Stdlib::Absolutepath) (defaults to: $::nut::params::state_dir)

    Top-level state directory, usually /var/run/nut or /var/db/nut.

  • use_upssched (Boolean) (defaults to: false)

    Whether to use upssched for notifications or not.

  • user (String) (defaults to: $::nut::params::user)

    The unprivileged user used to drop root privileges.

See Also:



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'manifests/client.pp', line 46

class nut::client (
  Optional[Tuple[String, String]]                  $certident      = undef,
  Optional[Stdlib::Absolutepath]                   $certpath       = undef,
  Optional[Boolean]                                $certverify     = undef,
  Optional[Stdlib::Absolutepath]                   $cmdscript      = undef,
  Stdlib::Absolutepath                             $conf_dir       = $::nut::params::conf_dir,
  Optional[Integer[0]]                             $deadtime       = undef,
  Optional[Integer[0]]                             $finaldelay     = undef,
  Optional[Boolean]                                $forcessl       = undef,
  String                                           $group          = $::nut::params::group,
  Optional[Integer[0]]                             $hostsync       = undef,
  Integer[1]                                       $minsupplies    = 1,
  Optional[Integer[0]]                             $nocommwarntime = undef,
  Boolean                                          $use_upssched   = false,
  Optional[Stdlib::Absolutepath]                   $notifycmd      = $use_upssched ? {
    true    => $::nut::params::upssched, # lint:ignore:parameter_order
    default => undef,
  },
  Optional[Hash[Nut::Event, Tuple[Boolean, 3, 3]]] $notifyflag     = undef,
  Optional[Hash[Nut::Event, String]]               $notifymsg      = undef,
  String                                           $package_name   = $::nut::params::client_package_name,
  Optional[Integer[0]]                             $pollfreq       = undef,
  Optional[Integer[0]]                             $pollfreqalert  = undef,
  Optional[Integer[0]]                             $rbwarntime     = undef,
  String                                           $service_name   = $::nut::params::client_service_name,
  String                                           $shutdowncmd    = $::nut::params::shutdown_command,
  Stdlib::Absolutepath                             $state_dir      = $::nut::params::state_dir,
  String                                           $user           = $::nut::params::user,
) inherits nut::params {

  contain nut::client::config

  class { 'nut::common':
    certident      => $certident,
    certpath       => $certpath,
    certverify     => $certverify,
    cmdscript      => $cmdscript,
    conf_dir       => $conf_dir,
    deadtime       => $deadtime,
    finaldelay     => $finaldelay,
    forcessl       => $forcessl,
    group          => $group,
    hostsync       => $hostsync,
    minsupplies    => $minsupplies,
    nocommwarntime => $nocommwarntime,
    notifycmd      => $notifycmd,
    notifyflag     => $notifyflag,
    notifymsg      => $notifymsg,
    package_name   => $package_name,
    pollfreq       => $pollfreq,
    pollfreqalert  => $pollfreqalert,
    rbwarntime     => $rbwarntime,
    service_name   => $service_name,
    shutdowncmd    => $shutdowncmd,
    state_dir      => $state_dir,
    use_upssched   => $use_upssched,
    user           => $user,
  }

  Class['nut::client::config'] ~> Class['nut::common::service']
}