Cookbook upgrade


#1

Ohai, Chefs!

Recently, I’ve started work on upgrading cookbook collectd:
https://github.com/coderanger/chef-collectd (which looks abandoned)
Now I finished with completely rewritten cookbook:
https://github.com/jsirex/cookbook-collectd

I hope that is better now, but it supports Chef ~> 11.0.

If somebody is interesting on collectd cookbook it will be great if you
will try my :slight_smile: (It is my first try to write serious cookbook).

Here is major changes:

  1. Added many skeleton files (Gemfile, Berksfile, Rake, Kitchen, etc)
  2. Introduced full testing with rubocop, foodcritic, chefspec,
    test-kitchen
  3. Attributes have been converted from symbols to strings
  4. Cookbook by default does not install any plugin
  5. Supported platform for now Debian and Ubuntu
  6. Definition has been removed
  7. Added HWR and many HWP (provider is chosen dynamically by name of the
    plugin)
  8. Added possibility to multiply times call collectd_plugin resource
    from different recipes or cookbooks. Options are merged!
  9. Cookbook is flexible: if you want to add custom plugin or override
    behavior of existing one just define class
    Chef::Provider::CollectdPlugin <
    Chef::Provider::CollectdPlugin.
  10. Recipe “collectd::_test_plugins” added. You can use it as
    example/reference. Also specs are using this recipe for tests

best regards,
Yauhen


#2

Hello,

I haven’t had time to look at what you’ve done. But, here at RightScale
we have a fork that added support for CentOS that we haven’t gotten
around to contributing back. You may wish to take a look and see if you
can incorporate similar changes into your version:

Douglas William Thrift
http://douglasthrift.net/

On 8/27/2014 10:57 AM, Jek Sirex wrote:

Ohai, Chefs!

Recently, I’ve started work on upgrading cookbook collectd:
https://github.com/coderanger/chef-collectd (which looks abandoned)
Now I finished with completely rewritten cookbook:
https://github.com/jsirex/cookbook-collectd

I hope that is better now, but it supports Chef ~> 11.0.

If somebody is interesting on collectd cookbook it will be great if you
will try my :slight_smile: (It is my first try to write serious cookbook).

Here is major changes:

  1. Added many skeleton files (Gemfile, Berksfile, Rake, Kitchen, etc)
  2. Introduced full testing with rubocop, foodcritic, chefspec, test-kitchen
  3. Attributes have been converted from symbols to strings
  4. Cookbook by default does not install any plugin
  5. Supported platform for now Debian and Ubuntu
  6. Definition has been removed
  7. Added HWR and many HWP (provider is chosen dynamically by name of
    the plugin)
  8. Added possibility to multiply times call collectd_plugin resource
    from different recipes or cookbooks. Options are merged!
  9. Cookbook is flexible: if you want to add custom plugin or override
    behavior of existing one just define class
    Chef::Provider::CollectdPlugin <
    Chef::Provider::CollectdPlugin.
  10. Recipe “collectd::_test_plugins” added. You can use it as
    example/reference. Also specs are using this recipe for tests

best regards,
Yauhen


#3

Hi,

I recently went down this same round to find out Miah Johnson already had
a cookbook that did most of what I needed found here.

I ended up just forking hers, fixing bugs, and adding a bunch more tests. There
was a new release cut recently with these fixes.

–gregf

On 2014-08-27 20:57+0300, Jek Sirex wrote:

Ohai, Chefs!

Recently, I’ve started work on upgrading cookbook collectd:
https://github.com/coderanger/chef-collectd (which looks abandoned)
Now I finished with completely rewritten cookbook:
https://github.com/jsirex/cookbook-collectd

I hope that is better now, but it supports Chef ~> 11.0.

If somebody is interesting on collectd cookbook it will be great if you
will try my :slight_smile: (It is my first try to write serious cookbook).

Here is major changes:

  1. Added many skeleton files (Gemfile, Berksfile, Rake, Kitchen, etc)
  2. Introduced full testing with rubocop, foodcritic, chefspec,
    test-kitchen
  3. Attributes have been converted from symbols to strings
  4. Cookbook by default does not install any plugin
  5. Supported platform for now Debian and Ubuntu
  6. Definition has been removed
  7. Added HWR and many HWP (provider is chosen dynamically by name of the
    plugin)
  8. Added possibility to multiply times call collectd_plugin resource
    from different recipes or cookbooks. Options are merged!
  9. Cookbook is flexible: if you want to add custom plugin or override
    behavior of existing one just define class
    Chef::Provider::CollectdPlugin <
    Chef::Provider::CollectdPlugin.
  10. Recipe “collectd::_test_plugins” added. You can use it as
    example/reference. Also specs are using this recipe for tests

best regards,
Yauhen


#4

@Douglas, I’ve created task. Not sure I can directly apply this pull
request, but will try to apply changes manually.

@Greg, Yes I saw this repo and it is pretty cool! But there are few moments:

  1. I need a standalone collectd (not client or server mode). Yes, it sends
    metrics to graphite directly.
  2. I need enough flexibility. Cookbook should uses default, system way of
    installation and provides smart HWRPs. It easy to wrap it or use anywhere.
  3. I need to customize collectd_plugin behavior

Main feature I’ve implemented is ability to define collectd_plugin anywhere
in any order any times. Here is my case:
I have my-collectd wrapper. By default it installs collectd and some basics
plugins I want (load, memory, users, swap, df, process monitor for
chef-client, push to graphite).
Also I have my-apache cookbook. Here I have collectd_plugin ‘apache’. The
same for other services. They automatically adds required plugins. And no
matter in which order I use in run_list:
[“recipe[my-collectd]”, “recipe[my-apache]”] or [“recipe[my-apache]”,
“recipe[my-collectd]”] it works.
Previously, if you say in one cookbook "collectd_plugin ‘processes’ …"
then you will be unable to extend this definition from other cookbook. You
have to completely build options manually and define final LWRP only ones.

Now this:
https://github.com/jsirex/cookbook-collectd/blob/master/recipes/_test_plugins.rb#L123-L135
and
this:
https://github.com/jsirex/cookbook-collectd/blob/master/recipes/_test_plugins.rb#L196-L206
works as expected.

2014-08-28 4:12 GMT+03:00 Greg Fitzgerald greg@gregf.org:

Hi,

I recently went down this same round to find out Miah Johnson already had
a cookbook that did most of what I needed found here.

https://github.com/miah/chef-collectd

I ended up just forking hers, fixing bugs, and adding a bunch more tests.
There
was a new release cut recently with these fixes.

–gregf

On 2014-08-27 20:57+0300, Jek Sirex wrote:

Ohai, Chefs!

Recently, I’ve started work on upgrading cookbook collectd:
https://github.com/coderanger/chef-collectd (which looks abandoned)
Now I finished with completely rewritten cookbook:
https://github.com/jsirex/cookbook-collectd

I hope that is better now, but it supports Chef ~> 11.0.

If somebody is interesting on collectd cookbook it will be great if you
will try my :slight_smile: (It is my first try to write serious cookbook).

Here is major changes:

  1. Added many skeleton files (Gemfile, Berksfile, Rake, Kitchen, etc)
  2. Introduced full testing with rubocop, foodcritic, chefspec,
    test-kitchen
  3. Attributes have been converted from symbols to strings
  4. Cookbook by default does not install any plugin
  5. Supported platform for now Debian and Ubuntu
  6. Definition has been removed
  7. Added HWR and many HWP (provider is chosen dynamically by name of
    the
    plugin)
  8. Added possibility to multiply times call collectd_plugin resource
    from different recipes or cookbooks. Options are merged!
  9. Cookbook is flexible: if you want to add custom plugin or override
    behavior of existing one just define class
    Chef::Provider::CollectdPlugin <
    Chef::Provider::CollectdPlugin.
  10. Recipe “collectd::_test_plugins” added. You can use it as
    example/reference. Also specs are using this recipe for tests

best regards,
Yauhen