Puppet Class: cloudinsight_agent::integrations::directory

Inherits:
cloudinsight_agent::params
Defined in:
manifests/integrations/directory.pp

Overview

Class: cloudinsight_agent::integrations::directory

This class will install the necessary config to hook the directory check

Parameters:

$directory
    The directory to gather stats for
$name
    The name used to tag the metrics (directory alias)
$pattern
    The `fnmatch` pattern to use when reading the "directory"'s files. default "*"
$recursive
    Boolean, when true the stats will recurse into directories

Sample Usage:

class { 'cloudinsight_agent::integrations::directory' :
    directory     => '/mnt/media',
    name          => 'name,
    pattern       => '*',
    recursive     => true,
}

Parameters:

  • directory (Any) (defaults to: undef)
  • name (Any) (defaults to: '')
  • pattern (Any) (defaults to: '*')
  • recursive (Any) (defaults to: false)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'manifests/integrations/directory.pp', line 23

class cloudinsight_agent::integrations::directory (
  $directory = undef,
  $name      = '',
  $pattern   = '*',
  $recursive = false
) inherits cloudinsight_agent::params {

  if $directory == undef {
    fail('you must specify a directory path within the cloudinsight_agent::integrations::directory class')
  }

  file { "${cloudinsight_agent::params::conf_dir}/directory.yaml":
    ensure  => file,
    owner   => $cloudinsight_agent::params::cloudinsight_user,
    group   => $cloudinsight_agent::params::cloudinsight_group,
    mode    => '0600',
    content => template('cloudinsight_agent/agent-conf.d/directory.yaml.erb'),
    require => Package[$cloudinsight_agent::params::package_name],
    notify  => Service[$cloudinsight_agent::params::service_name]
  }
}