Skip to content

Commit

Permalink
Merge 92a286b into f0426c6
Browse files Browse the repository at this point in the history
  • Loading branch information
wildente committed Jun 14, 2017
2 parents f0426c6 + 92a286b commit f64a111
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,13 @@ class { 'collectd::plugin::fhcount':
}
```

#### Class: `collectd::plugin::fscache`

```puppet
class { 'collectd::plugin::fscache':
}
```

#### Class: `collectd::plugin::filecount`

```puppet
Expand Down
11 changes: 11 additions & 0 deletions manifests/plugin/fscache.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# https://collectd.org/wiki/index.php/Plugin:FSCache
class collectd::plugin::fscache (
$ensure = 'present',
) {

include ::collectd

collectd::plugin { 'fscache':
ensure => $ensure,
}
}
47 changes: 47 additions & 0 deletions spec/classes/collectd_plugin_fscache_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
require 'spec_helper'

describe 'collectd::plugin::fscache', type: :class do
let :facts do
{
collectd_version: '4.7.0',
operatingsystemmajrelease: '7',
python_dir: '/usr/local/lib/python2.7/dist-packages'
}
end

context ':ensure => present' do
let :facts do
{
osfamily: 'FreeBSD',
collectd_version: '4.7.0',
operatingsystemmajrelease: '7',
python_dir: '/usr/local/lib/python2.7/dist-packages'
}
end

it 'Will create 10-fscache.conf' do
is_expected.to contain_file('fscache.load').with(ensure: 'present',
path: '/usr/local/etc/collectd/10-fscache.conf',
content: %r{\#\ Generated by Puppet\nLoadPlugin fscache\n})
end
end

context ':ensure => absent' do
let :facts do
{
osfamily: 'FreeBSD',
collectd_version: '4.7.0',
operatingsystemmajrelease: '7',
python_dir: '/usr/local/lib/python2.7/dist-packages'
}
end
let :params do
{ ensure: 'absent' }
end

it 'Will not create 10-fscache.conf' do
is_expected.to contain_file('fscache.load').with(ensure: 'absent',
path: '/usr/local/etc/collectd/10-fscache.conf')
end
end
end

0 comments on commit f64a111

Please sign in to comment.