Puppet Class: arpwatch

Inherits:
arpwatch::params
Defined in:
manifests/init.pp

Overview

Install and configure arpwatch

Examples:

Basic installation and configuration of arpwatch

include ::arpwatch

Install service and set it to send email alerts

class { 'arpwatch':
  dest_email    => 'foo@bar.org',
  source_email  => 'arpwatch@baz.com',
}

Parameters:

  • config_file (String) (defaults to: $arpwatch::params::config_file)

    The configuration file on the server to manage.

  • config_template (String) (defaults to: $arpwatch::params::config_template)

    The template to use when generating the config file

  • dest_email (String) (defaults to: '-')

    The email address to send arpwatch alerts to.

  • interface (String) (defaults to: $arpwatch::params::interface)

    Which interface to watch for arp traffic

  • opts (String) (defaults to: $arpwatch::params::opts)

    Additional command line options to pass to arpwatch at start

  • package_ensure (String) (defaults to: 'installed')

    Ensure value passed to the package resource

  • package_name (String) (defaults to: $arpwatch::params::package_name)

    Name of the package to manage

  • service_enable (Boolean) (defaults to: true)

    Enable value, passed to the service resource

  • service_ensure (String) (defaults to: 'running')

    Ensure value, passed to the service resource

  • service_name (String) (defaults to: $arpwatch::params::service_name)

    Name of the service to manage

  • service_user (String) (defaults to: $arpwatch::params::service_user)

    Defines the user account that arpwatch will run under

  • source_email (String) (defaults to: "arpwatch@${::fqdn}")

    Define the source email address for arpwatch alerts (RedHat only)



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'manifests/init.pp', line 26

class arpwatch (
  $config_file = $arpwatch::params::config_file,
  $config_template = $arpwatch::params::config_template,
  $dest_email = '-',
  $interface = $arpwatch::params::interface,
  $opts = $arpwatch::params::opts,
  $package_ensure = 'installed',
  $package_name = $arpwatch::params::package_name,
  $service_enable = true,
  $service_ensure = 'running',
  $service_name = $arpwatch::params::service_name,
  $service_user = $arpwatch::params::service_user,
  $source_email = "arpwatch@${::fqdn}",
  ) inherits arpwatch::params {
    validate_string($dest_email)
    validate_string($package_name)
    validate_string($service_user)
    validate_string($service_name)
    validate_string($interface)
    validate_absolute_path($config_file)
    validate_string($package_ensure)
    validate_string($source_email)
    validate_bool($service_enable)
    validate_string($service_ensure)

    package {
      $package_name:
      ensure => $package_ensure,
    }
    file {
      $config_file:
      ensure  => 'file',
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      content => template($config_template),
    }
    service {
      $service_name:
      ensure => $service_ensure,
      enable => $service_enable,
    }
    Package[$package_name]->File[$config_file]~>Service[$service_name]
}