From ff43651928be4a66b1b4e4a10a4426a780bf0b6f Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Tue, 22 Jan 2013 11:43:40 +0000 Subject: [PATCH 1/4] first pass at centos support adds depends on yum & bumps version --- metadata.rb | 3 ++- recipes/default.rb | 21 ++++++++++++++------- recipes/yum.rb | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 recipes/yum.rb diff --git a/metadata.rb b/metadata.rb index 1c907e7..87a62a7 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,7 +3,8 @@ license "All rights reserved" description "Installs/Configures tracelytics" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version "0.0.1" +version "0.0.2" depends "python" depends "apt" +depends "yum" diff --git a/recipes/default.rb b/recipes/default.rb index 2935ef5..0a70f54 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -6,19 +6,26 @@ # - tracelytics::apache for Apache instrumentation # - tracelytics::python for Python instrumentation -# For now, we assume you're on a Debian/Ubuntu system. If you are not -# this recipe will fail horribly. -include_recipe "tracelytics::apt" +case node['platform'] +when "ubuntu", "debian" + include_recipe "tracelytics::apt" +when "redhat", "centos" + include_recipe "tracelytics::yum" +end # Be sure to set your access_key in an environment/role/node attribute. template "/etc/tracelytics.conf" do source "etc/tracelytics.conf.erb" end -# Be sure to include the tracelytics::apt recipe before this in your -# run list. Need to make this more agnostic on distribution, but -# we don't use RedHat/CentOS and I'm lazy. -%w{liboboe0 liboboe-dev tracelyzer}.each do |package_name| +# Install the packages +case node['platform'] +when "ubuntu", "debian" + packages = ["liboboe0", "liboboe-dev", "tracelyzer"] +when "redhat", "centos" + packages = ["liboboe", "liboboe-devel", "tracelyzer"] +end +packages.each do |package_name| package package_name do action :install end diff --git a/recipes/yum.rb b/recipes/yum.rb new file mode 100644 index 0000000..2147e25 --- /dev/null +++ b/recipes/yum.rb @@ -0,0 +1,14 @@ +majorver = node['platform_version'].to_i.to_s +arch = node['kernel']['machine'] + +yum_key "RPM-GPG-KEY-tracelytics" do + url "https://yum.tracelytics.com/RPM-GPG-KEY-tracelytics" + action :add +end + +yum_repository "tracelytics" do + url "http://yum.tracelytics.com/#{majorver}/#{arch}" + key "RPM-GPG-KEY-tracelytics" + description "Tracelytics repository" + action :add +end From 587f4bbe822912a60c922027e4f9f94564fc7a21 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Tue, 22 Jan 2013 12:32:25 +0000 Subject: [PATCH 2/4] use same indent as original --- recipes/yum.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/yum.rb b/recipes/yum.rb index 2147e25..161289c 100644 --- a/recipes/yum.rb +++ b/recipes/yum.rb @@ -2,13 +2,13 @@ arch = node['kernel']['machine'] yum_key "RPM-GPG-KEY-tracelytics" do - url "https://yum.tracelytics.com/RPM-GPG-KEY-tracelytics" - action :add + url "https://yum.tracelytics.com/RPM-GPG-KEY-tracelytics" + action :add end yum_repository "tracelytics" do - url "http://yum.tracelytics.com/#{majorver}/#{arch}" - key "RPM-GPG-KEY-tracelytics" - description "Tracelytics repository" - action :add + url "http://yum.tracelytics.com/#{majorver}/#{arch}" + key "RPM-GPG-KEY-tracelytics" + description "Tracelytics repository" + action :add end From d65d8635a20f2c0e405b18cb2fb994a6cf882303 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Tue, 22 Jan 2013 17:56:39 +0000 Subject: [PATCH 3/4] Update README.md Update README to reflect CentOS support --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ec55f5f..47a8dc2 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,9 @@ Platform -------- * Debian, Ubuntu +* CentOS 6 -Tested on Ubuntu 10.04.3 LTS (Lucid). RHEL, CentOS, and Fedora are not currently supported, but could be with little effort. +Tested on Ubuntu 10.04.3 LTS (Lucid). RHEL and Fedora are not currently tested but should work with the same components as CentOS. Cookbooks --------- @@ -55,7 +56,7 @@ Installs `libapache2-mod-oboe` and configures your `/etc/apache2/mods-available/ apt --- -Configures the Tracelytics repository and installs their packaging key. +Configures the Tracelytics repository and installs their packaging key for apt based systems. python ------ @@ -66,3 +67,8 @@ mysql ----- **NOTE:** This recipe is currently not working. It is recommended you build the package manually and add it to your own apt repository. Downloads the MySQL client library patch from Tracelytics and builds a Debian package with the modified source. Installs the package after a successful build, but will not run again after the initial build. + +yum +--- + +Configures the tracelytics repository and installs the packaging key for yum based systems. From 451dca95822c423a8d0a580299dcf9c09c51f934 Mon Sep 17 00:00:00 2001 From: Paul Thomas Date: Tue, 22 Jan 2013 17:58:25 +0000 Subject: [PATCH 4/4] Update README.md Update recipe list to include yum, update existing links from deprecated opscode/cookbooks to new opscode-cookbooks org --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 47a8dc2..d9f559f 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,10 @@ Tested on Ubuntu 10.04.3 LTS (Lucid). RHEL and Fedora are not currently tested b Cookbooks --------- -* [apache2](https://github.com/opscode/cookbooks/tree/master/apache2) -* [apt](https://github.com/opscode/cookbooks/tree/master/apt) -* [python](https://github.com/opscode/cookbooks/tree/master/python) - +* [apache2](https://github.com/opscode-cookbooks/apache2) +* [apt](https://github.com/opscode-cookbooks/apt) +* [python](https://github.com/opscode-cookbooks/python) +* [yum](https://github.com/opscode-cookbooks/yum) Attributes ==========