From ad4d8d1b0a207ecd47dfaac90c47a6bd0f7db612 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 8 Nov 2010 22:44:51 -0200 Subject: Adding UPS NIS support --- manifests/subsystems/firewall.pp | 12 ++++++++++++ manifests/subsystems/ups.pp | 28 +++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) (limited to 'manifests') diff --git a/manifests/subsystems/firewall.pp b/manifests/subsystems/firewall.pp index eaf5ef7..24d66b8 100644 --- a/manifests/subsystems/firewall.pp +++ b/manifests/subsystems/firewall.pp @@ -303,3 +303,15 @@ class firewall::printer { order => "201", } } + +class firewall::ups { + shorewall::rule { "ups": + action => 'ACCEPT', + source => 'net', + destination => '$FW', + proto => 'tcp', + destinationport => "3551", + ratelimit => '-', + order => "200", + } +} diff --git a/manifests/subsystems/ups.pp b/manifests/subsystems/ups.pp index 558941e..648e0df 100644 --- a/manifests/subsystems/ups.pp +++ b/manifests/subsystems/ups.pp @@ -1,12 +1,34 @@ class ups { include apcupsd + case $ups_type { + '': { $ups_type = 'usb' } + } + + case $ups_cable { + '': { $ups_cable = 'usb' } + } + + case $ups_dev { + '': { $ups_dev = '/dev/usb/hiddev0' } + } + + case $ups_nisip { + '': { $ups_nisip = '127.0.0.1' } + } + + case $ups_polltime { + '': { $ups_polltime = '60' } + } + case $has_ups { true: { apcupsd::ups { "ups0": - upstype => 'usb', - cable => 'usb', - device => '/dev/usb/hiddev0', + upstype => $ups_type, + cable => $ups_cable, + device => $ups_dev, + nisip => $ups_nisip, + polltime => $ups_polltime, } } } -- cgit v1.2.3