Puppet Class: collectd::plugin::dns
- Defined in:
- manifests/plugin/dns.pp
Overview
Class: collectd::plugin::dns
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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 |
# File 'manifests/plugin/dns.pp', line 3
class collectd::plugin::dns (
$ensure = 'present',
$ignoresource = undef,
$interface = 'any',
$interval = undef,
$manage_package = undef,
$package_name = 'collectd-dns',
$selectnumericquerytypes = true,
) {
include ::collectd
$_manage_package = pick($manage_package, $::collectd::manage_package)
if $_manage_package {
package { 'collectd-dns':
ensure => $ensure,
name => $package_name,
}
}
validate_re($ensure,'^(present)|(absent)$',
"collectd::plugin::dns::ensure is <${ensure}> and must be either 'present' or 'absent'.")
if ( $ignoresource != undef ) and ( is_ip_address($ignoresource) == false ) {
fail("collectd::plugin::dns::ignoresource is <${ignoresource}> and must be a valid IP address.")
}
validate_string($interface)
if $interval != undef {
validate_numeric($interval)
}
if is_string($selectnumericquerytypes) == true {
$selectnumericquerytypes_real = str2bool($selectnumericquerytypes)
} else {
$selectnumericquerytypes_real = $selectnumericquerytypes
}
validate_bool($selectnumericquerytypes_real)
collectd::plugin { 'dns':
ensure => $ensure,
content => template('collectd/plugin/dns.conf.erb'),
interval => $interval,
}
}
|