From 301a47af2304660e93030079ce89f35a547da50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20M=E4kinen?= Date: Thu, 10 Mar 2011 22:55:34 +0200 Subject: [PATCH] Added support for apcupsd clients. --- apcupsd/manifests/init.pp | 24 +++++++++++++++++++++++ apcupsd/templates/apcupsd.conf.client.erb | 8 ++++++++ 2 files changed, 32 insertions(+) create mode 100644 apcupsd/templates/apcupsd.conf.client.erb diff --git a/apcupsd/manifests/init.pp b/apcupsd/manifests/init.pp index 7011ac2..e6bfaee 100644 --- a/apcupsd/manifests/init.pp +++ b/apcupsd/manifests/init.pp @@ -13,4 +13,28 @@ class apcupsd { require => Package["apcupsd"], } + file { "/etc/apcupsd/apcupsd.conf": + ensure => present, + mode => 0644, + owner => "root", + group => "root", + require => Package["apcupsd"], + notify => Service["apcupsd"], + } + +} + +# Install APC UPS client. +# +# === Global variables +# +# $apcupsd_server: +# Server address where apcupsd server is running. +# +class apcupsd::client inherits apcupsd { + + File["/etc/apcupsd/apcupsd.conf"] { + content => template("apcupsd/apcupsd.conf.client.erb"), + } + } diff --git a/apcupsd/templates/apcupsd.conf.client.erb b/apcupsd/templates/apcupsd.conf.client.erb new file mode 100644 index 0000000..ef4df6c --- /dev/null +++ b/apcupsd/templates/apcupsd.conf.client.erb @@ -0,0 +1,8 @@ +## apcupsd.conf v1.1 ## +UPSCABLE ether +UPSTYPE net +LOCKFILE /var/lock +DEVICE <%= apcupsd_server %>:3551 +UPSCLASS standalone +UPSMODE disable +NETTIME 10