Skip to content

Instantly share code, notes, and snippets.

@rottenbytes
Forked from joewilliams/default.rb
Created February 21, 2012 10:26
Show Gist options
  • Save rottenbytes/1875668 to your computer and use it in GitHub Desktop.
Save rottenbytes/1875668 to your computer and use it in GitHub Desktop.
#
# Cookbook Name:: haproxy
# Recipe:: default
# Author:: Joe Williams <joe@joetify.com>
package "haproxy" do
action :install
end
haproxy_templates = [ "global", "defaults", "frontend", "SOMEBACKEND" ]
haproxy_templates.each do |t|
template "#{node[:haproxy_dir]}/conf/#{t}.cfg" do
source "#{t}.erb"
owner 0
group 0
mode "0644"
notifies :restart, "service[haproxy]"
end
end
service "haproxy" do
supports :status => true, :restart => true, :reload => true
action [ :enable, :start ]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment