aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystems/ups.pp
blob: 47b9f13f4637ee025783a34a39ae68ee2f487a77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class ups(
    $include        = hiera('nodo::ups::include',        false),
    $type           = hiera('nodo::ups::type',           'usb'),
    $cable          = hiera('nodo::ups::cable',          'usb'),
    $dev            = hiera('nodo::ups::dev',            '/dev/usb/hiddev0'),
    $nisip          = hiera('nodo::ups::nisip',          '127.0.0.1'),
    $polltime       = hiera('nodo::ups::polltime',       '60'),
    $onbatterydelay = hiera('nodo::ups::onbatterydelay', '6'),
    $batterylevel   = hiera('nodo::ups::batterylevel',   '5'),
    $minutes        = hiera('nodo::ups::minutes',        '3'
) {
  case $include {
    true: {
      class { "apcupsd":
        upstype        => $type,
        cable          => $cable,
        device         => $dev,
        nisip          => $nisip,
        polltime       => $polltime,
        onbatterydelay => $onbatterydelay,
        batterylevel   => $batterylevel,
        minutes        => $minutes,
      }
    }
  }
}