Skip to content

Instantly share code, notes, and snippets.

@johnfitzpatrick
Created May 28, 2015 12:53
Show Gist options
  • Save johnfitzpatrick/a1b7a3194d8c388b7b1f to your computer and use it in GitHub Desktop.
Save johnfitzpatrick/a1b7a3194d8c388b7b1f to your computer and use it in GitHub Desktop.
package 'haproxy' do
action :install
end
pool_members = search("node","role:webserver")
template "/etc/haproxy/haproxy.cfg" do
source "haproxy.cfg.erb"
owner "root"
group "root"
mode 0644
variables :pool_members => pool_members.uniq
notifies :restart, "service[haproxy]"
end
service 'haproxy' do
action [:start, :enable]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment