]> gitweb.fluxo.info Git - puppet-apcupsd.git/commitdiff
Adding more battery parameters
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 28 Jun 2012 19:43:22 +0000 (16:43 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 28 Jun 2012 19:43:22 +0000 (16:43 -0300)
manifests/init.pp
templates/apcupsd.conf.erb

index 2035f47a516e81052a327490623b51fec1e70098..5374ba59129bbce6cbb001911658165f7fbc3957 100644 (file)
@@ -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":
index 03a9c08efa78179e9a99cda1b9c698aa131d224c..6f967757fd6bb2b3c1161d30bcf979b754c4c1e0 100644 (file)
@@ -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.