Puppet Class: collectd::plugin::disk

Defined in:
manifests/plugin/disk.pp

Overview

Parameters:

  • disks (Array) (defaults to: [])
  • ensure (Any) (defaults to: 'present')
  • ignoreselected (Boolean) (defaults to: false)
  • interval (Any) (defaults to: undef)
  • manage_package (Any) (defaults to: undef)
  • package_name (Any) (defaults to: 'collectd-disk')
  • udevnameattr (Any) (defaults to: undef)
  • package_install_options (Optional[Array[String]]) (defaults to: undef)


2
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
# File 'manifests/plugin/disk.pp', line 2

class collectd::plugin::disk (
  Array $disks            = [],
  $ensure                 = 'present',
  Boolean $ignoreselected = false,
  $interval               = undef,
  $manage_package         = undef,
  $package_name           = 'collectd-disk',
  $udevnameattr           = undef,
  Optional[Array[String]] $package_install_options = undef
) {
  include collectd

  if $facts['os']['family'] == 'RedHat' {
    if $manage_package != undef {
      $_manage_package = $manage_package
    } else {
      if versioncmp($collectd::collectd_version_real, '5.5') >= 0
      and versioncmp($facts['os']['release']['major'],'8') >= 0 {
        $_manage_package = true
      } else {
        $_manage_package = false
      }
    }

    if $ensure == 'present' {
      $ensure_real = $collectd::package_ensure
    } elsif $ensure == 'absent' {
      $ensure_real = 'absent'
    }

    if $_manage_package {
      package { 'collectd-disk':
        ensure          => $ensure_real,
        name            => $package_name,
        install_options => $package_install_options,
      }
    }
  }

  collectd::plugin { 'disk':
    ensure   => $ensure,
    content  => template('collectd/plugin/disk.conf.erb'),
    interval => $interval,
  }
}