Permalink
Browse files

* install in /usr/local/share now

 * made base_path an attribute
 * ensure base_path exists
  • Loading branch information...
1 parent 8b73d4b commit 6814e79dd9add8a88d58fafc600fbfe160b33a25 @till committed Jun 15, 2012
Showing with 16 additions and 3 deletions.
  1. +3 −1 haproxy/attributes/default.rb
  2. +13 −2 haproxy/recipes/ctl.rb
@@ -4,7 +4,7 @@
})
end
-default[:haproxy] = {}
+default[:haproxy] = {}
default[:haproxy][:errorloc] = {
"401" => "401.html",
"403" => "403.html",
@@ -15,4 +15,6 @@
"504" => "5xx.html"
}
+default[:haproxy][:ctl][:base_path] = "/usr/local/share"
default[:silverline][:haproxy_name] = "haproxy"
+
View
@@ -1,9 +1,20 @@
-git "/usr/share/haproxyctl" do
+base_path = node[:haproxy][:ctl][:base_path]
+
+# ensure directory exists
+directory base_path do
+ owner "root"
+ group "root"
+ mode "0755"
+ action :create
+ recursive true
+end
+
+git "#{base_path}/haproxyctl" do
repository "git://github.com/flores/haproxyctl.git"
reference "0.1.0"
action :sync
end
link "/etc/init.d/haproxyctl" do
- to "/usr/share/haproxyctl/bin/haproxyctl"
+ to "#{base_path}/haproxyctl/bin/haproxyctl"
end

0 comments on commit 6814e79

Please sign in to comment.