Skip to content

Commit

Permalink
Merge pull request #782 from juniorsysadmin/cgroup-datatypes
Browse files Browse the repository at this point in the history
collectd::plugin::cgroups - Add more data types
  • Loading branch information
bastelfreak authored Apr 8, 2018
2 parents cb7bbd6 + da51e75 commit 6ea8adc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 4 additions & 6 deletions manifests/plugin/cgroups.pp
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# https://collectd.org/wiki/index.php/Plugin:cgroups
class collectd::plugin::cgroups (
Optional[Array] $cgroups = undef,
$ensure = 'present',
Boolean $ignore_selected = false,
$interval = undef,
Array $cgroups = [],
Enum['present', 'absent'] $ensure = 'present',
Boolean $ignore_selected = false,
Optional[Integer[1]] $interval = undef,
) {

include ::collectd

$cgroups_real = pick($cgroups, [])

collectd::plugin { 'cgroups':
ensure => $ensure,
content => template('collectd/plugin/cgroups.conf.erb'),
Expand Down
4 changes: 4 additions & 0 deletions spec/classes/collectd_plugin_cgroups_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
facts
end

let :pre_condition do
'include collectd'
end

options = os_specific_options(facts)

context ':ensure => present, default params' do
Expand Down
2 changes: 1 addition & 1 deletion templates/plugin/cgroups.conf.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Plugin cgroups>
<% @cgroups_real.each do |cgroup| -%>
<% @cgroups.each do |cgroup| -%>
CGroup "<%= cgroup %>"
<% end -%>
IgnoreSelected <%= @ignore_selected %>
Expand Down

0 comments on commit 6ea8adc

Please sign in to comment.