-
-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add table plugin #826
Add table plugin #826
Conversation
manifests/plugin/table.pp
Outdated
| class collectd::plugin::table ( | ||
| Enum['present', 'absent'] $ensure = 'present', | ||
| Integer $order = 10, | ||
| Hash[String, Struct[{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this awesome and detailed datatype! Can you please abstract it into its own datatype in https://github.com/voxpupuli/puppet-collectd/tree/master/types ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, awesome I was not aware we can declare type there :)
manifests/plugin/table.pp
Outdated
| }], 1] | ||
| }], 1] $tables, | ||
| ) { | ||
| include ::collectd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please don't add the leading :: infront of a class name. This isn't needed anymore since we don't support puppet 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, old habbit.
| @@ -0,0 +1,27 @@ | |||
| <Plugin "table"> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yey epp template \o/
| <Plugin "table"> | ||
| <% $collectd::plugin::table::tables.each |$path, $table| { -%> | ||
| <Table "<%= $path %>"> | ||
| <% unless $table['plugin'] =~ Undef { -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if $table['plugin'] is the same as unless $table['plugin'] =~ Undef. I think the if notation is shorter and better to read?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if plugin is set "", the if version will evaluation to false while the unless to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right, good catch.
|
Thanks for your work @sileht! can you please take a look at the inline comments I made? |
No description provided.