Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Separate out build and install steps.

  • Loading branch information...
commit f8e807e6b893dacf04d7d60882961347fe0c5e88 1 parent ce65f52
@mheffner mheffner authored
View
2  metadata.rb
@@ -9,3 +9,5 @@
depends "collectd"
recipe "collectd-librato", "Installs Librato's Collectd Plugin"
+recipe "collectd-librato::build", "Just build plugin"
+recipe "collectd-librato::install", "Just install plugin"
View
31 recipes/build.rb
@@ -0,0 +1,31 @@
+#
+# Cookbook Name:: collectd-librato
+# Recipe:: default
+#
+# Copyright 2012, Librato
+#
+# All rights reserved - Do Not Redistribute
+#
+
+include_recipe "git"
+
+repo = node[:collectd_librato][:repo]
+ver = node[:collectd_librato][:version]
+
+package "libpython2.7"
+
+directory "/opt/src"
+
+git "/opt/src/collectd-librato-#{ver}" do
+ repository repo
+ reference "v#{ver}"
+ action :sync
+end
+
+bash "install_collectd_librato" do
+ cwd "/opt/src/collectd-librato-#{ver}"
+ code <<EOH
+make install
+EOH
+ not_if { File.exist?("/opt/collectd-librato-#{ver}") }
+end
View
31 recipes/default.rb
@@ -10,32 +10,5 @@
include_recipe "collectd"
include_recipe "git"
-repo = node[:collectd_librato][:repo]
-ver = node[:collectd_librato][:version]
-
-package "libpython2.7"
-
-directory "/opt/src"
-
-git "/opt/src/collectd-librato-#{ver}" do
- repository repo
- reference "v#{ver}"
- action :sync
-end
-
-bash "install_collectd_librato" do
- cwd "/opt/src/collectd-librato-#{ver}"
- code <<EOH
-make install
-EOH
- not_if { File.exist?("/opt/collectd-librato-#{ver}") }
-end
-
-# Install plugin
-collectd_python_plugin "collectd-librato" do
- path "/opt/collectd-librato-#{ver}/lib"
- options({
- "APIToken" => node[:collectd_librato][:api_token],
- "Email" => node[:collectd_librato][:email]
- })
-end
+include_recipe "collectd-librato::build"
+include_recipe "collectd-librato::install"
View
10 recipes/install.rb
@@ -0,0 +1,10 @@
+include_recipe "collectd"
+
+# Install plugin
+collectd_python_plugin "collectd-librato" do
+ path "/opt/collectd-librato-#{ver}/lib"
+ options({
+ "APIToken" => node[:collectd_librato][:api_token],
+ "Email" => node[:collectd_librato][:email]
+ })
+end
Please sign in to comment.
Something went wrong with that request. Please try again.