diff --git a/README.md b/README.md index ec55f5f..d9f559f 100644 --- a/README.md +++ b/README.md @@ -15,16 +15,17 @@ 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 --------- -* [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 ========== @@ -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. 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..161289c --- /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