Puppet Class: psick::monitor::snmpd

Defined in:
manifests/monitor/snmpd.pp

Overview

This class manages the installation and configuration of snmpd via tp

Parameters:

  • ensure (Enum['present','absent']) (defaults to: 'present')

    If to install or remove the snmpd package

  • config_dir_source (Variant[String[1],Undef]) (defaults to: undef)

    The source to use (as used in source =>) to populate the whole snmpd configuration directory

  • config_file_template (String) (defaults to: '')

    The erb template (as used in template()) to manage the content of the snmpd main.cf file

  • options

    An open hash of options to use in the provided template. Their keys are merged with some class defaults Note: This variable is not a class paramenter but it’s looked up with hiera_hash(‘psick::logs::snmpd::options’, {} )

  • serverif (String) (defaults to: $::psick::primary_ip)

    The primary server IP. Default value is from $::psick::primary_ip

  • is_cluster

    If the server is a cluster member. If so extra configs are added to the default template

  • extra_packages (Array) (defaults to: [])

    An array of extra snmdp related packages to install



18
19
20
21
22
23
24
25
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
# File 'manifests/monitor/snmpd.pp', line 18

class psick::monitor::snmpd (
  Array                    $extra_packages             = [],
  Enum['present','absent'] $ensure                     = 'present',
  Variant[String[1],Undef] $config_dir_source          = undef,
  String                   $config_file_template       = '',
  String                   $serverif                   = $::psick::primary_ip,
) {

  $options_default = {
    'rocommunity' => 'public',
  }

  $options_user=hiera_hash('psick::monitor::snmpd::options', {} )
  $options=merge($options_default,$options_user)

  ::tp::install { 'snmpd':
    ensure        => $ensure,
  }

  $extra_packages.each |$pkg| {
    ensure_packages($pkg)
  }

  if $config_file_template != '' {
    ::tp::conf { 'snmpd':
      ensure       => $ensure,
      template     => $config_file_template,
      options_hash => $options,
    }
  }

  ::tp::dir { 'snmpd':
    ensure => $ensure,
    source => $config_dir_source,
  }
}