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