summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-06-28 16:43:22 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-06-28 16:43:22 -0300
commit930ce96d0854487a29c73ecca775f3ea2769a1ab (patch)
treee1e9cd31e2c525557fe5339e9107377d8a29af87
parent7593727f637a495495a4b032a137fcf7fb314384 (diff)
downloadpuppet-apcupsd-930ce96d0854487a29c73ecca775f3ea2769a1ab.tar.gz
puppet-apcupsd-930ce96d0854487a29c73ecca775f3ea2769a1ab.tar.bz2
Adding more battery parameters
-rw-r--r--manifests/init.pp5
-rw-r--r--templates/apcupsd.conf.erb6
2 files changed, 7 insertions, 4 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 2035f47..5374ba5 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -22,7 +22,10 @@ class apcupsd(
$device = '/dev/ttyS0',
$ensure = 'present',
$nisip = '127.0.0.1',
- $polltime = '60' )
+ $polltime = '60',
+ $onbatterydelay = '6',
+ $batterylevel = '5',
+ $minutes = '3')
{
package { "apcupsd":
diff --git a/templates/apcupsd.conf.erb b/templates/apcupsd.conf.erb
index 03a9c08..6f96775 100644
--- a/templates/apcupsd.conf.erb
+++ b/templates/apcupsd.conf.erb
@@ -118,7 +118,7 @@ NOLOGINDIR /etc
# ONBATTERYDELAY time. If you don't want to be annoyed by short
# powerfailures, make sure that apccontrol powerout does nothing
# i.e. comment out the wall.
-ONBATTERYDELAY 6
+ONBATTERYDELAY <%= onbatterydelay %>
#
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
@@ -128,12 +128,12 @@ ONBATTERYDELAY 6
# If during a power failure, the remaining battery percentage
# (as reported by the UPS) is below or equal to BATTERYLEVEL,
# apcupsd will initiate a system shutdown.
-BATTERYLEVEL 5
+BATTERYLEVEL <%= batterylevel %>
# If during a power failure, the remaining runtime in minutes
# (as calculated internally by the UPS) is below or equal to MINUTES,
# apcupsd, will initiate a system shutdown.
-MINUTES 3
+MINUTES <%= minutes %>
# If during a power failure, the UPS has run on batteries for TIMEOUT
# many seconds or longer, apcupsd will initiate a system shutdown.