diff --git a/arpwatch/manifests/init.pp b/arpwatch/manifests/init.pp index c4e831b..6301aa4 100644 --- a/arpwatch/manifests/init.pp +++ b/arpwatch/manifests/init.pp @@ -1,16 +1,32 @@ # Install arpwatch daemon # -class arpwatch { +# === Parameters +# +# $interface: +# Network interface to monitor. +# +class arpwatch($interface) { package { "arpwatch": ensure => installed, } - service { "arpwatch": - ensure => running, - enable => true, + file { "/etc/sysconfig/arpwatch": + ensure => present, + content => template("arpwatch/arpwatch.sysconfig.erb"), + mode => "0644", + owner => "root", + group => "root", require => Package["arpwatch"], + notify => Service["arpwatch"], + } + + service { "arpwatch": + ensure => running, + enable => true, + hasstatus => true, + require => Package["arpwatch"], } } diff --git a/arpwatch/templates/arpwatch.sysconfig.erb b/arpwatch/templates/arpwatch.sysconfig.erb new file mode 100644 index 0000000..3d097ee --- /dev/null +++ b/arpwatch/templates/arpwatch.sysconfig.erb @@ -0,0 +1,4 @@ +# -u : defines with what user id arpwatch should run +# -e : the where to send the reports +# -s : the -address +OPTIONS="-u arpwatch -e root -i <%= @interface %> -s 'root (Arpwatch)'"