opscode-cookbooks/cloudkick — pull request #3 by davidc-donorschoose (2012-12-06 22:54:00+00:00)
Title: [COOK-2023]  Add chef-cloudkick support for CentOS 6.3 and a separate recipes/configure.rb for speedy reconfigurations

My big change was to refactor recipes/default.rb to split out a separate recipes/configure.rb. This allows in-house recipes to include_recipe "cloudkick::configure" to get the full benefit of updating /etc/cloudkick.conf and restarting the cloudkick-agent service without the significant wait for package managers like yum to update, etc.

Notice that recipes/default.rb actually does include_recipe "cloudkick::configure" so there should be no backward-compatability downside for this refactor. That is, if you accept my pull request, it should be a simple drop-in to anyone who built on your cookbook.

I added a few new node attributes for building /etc/cloudkick.conf, which I believe are going to be generally useful. I tried to supply sensible defaults in the attributes/default.rb file.

Finally, I found that the CentOS RPM wasn't installing cleanly. I had two problems, really, so I fixed them both in recipes/default.rb. It seems hacky, but apt/yum/rpm isn't that well-integrated with chef, so there always seem to be many special cases. I'm using CentOS 6.3, chef 10.16.2 and ruby 1.8.7 -- which might be related to the problem. I'll detail my problems below, in case you need some insight.

=====
(1) The cloudkick yum_repository has a dependency incompatibility, so I had to prevent both package "cloudkick-agent" and yum_repository "cloudkick" from executing on my platform -- that is, unless (node['platform'] == 'centos' && node['platform_version'].to_f >= 6.0)

Here is the error that happens on the linux command-line, which causes my chef run to choke if any cloudkick yum anything is executed on my platform:

# yum -d0 -e0 -y install cloudkick-agent-0.9.17-0
Error: Package: cloudkick-config-1.0.4-0.x86_64 (cloudkick)
Requires: libcurl.so.3()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

=====
(2) I could not get the rpm_package to work with the source given as an http: URL. That certainly would be cleaner, but I have a feeling I have some distro or chef version problems. To make it work, I resorted to using remote_file to download the RPM files and a verbose rpm_package to install them.