Support
Issues have been disabled for this repository.
Any issues with this cookbook should be raised here:
https://github.com/rcbops/chef-cookbooks/issues
Please title the issue as follows:
[haproxy]: <short description of problem>
In the issue description, please include a longer description of the issue, along with any relevant log/command/error output.
If logfiles are extremely long, please place the relevant portion into the issue description, and link to a gist containing the entire logfile
Please see the contribution guidelines for more information about contributing to this cookbook.
Description
Installs and configures haproxy for use in an Openstack deployment
Requirements
Chef 11.0 or higher required (for Chef environment use).
Platforms
This cookbook is actively tested on the following platforms/versions:
- Ubuntu-12.04
- CentOS-6.3
While not actively tested, this cookbook should also work the following platforms:
- Debian/Mint derivitives
- Amazon/Oracle/Scientific/RHEL
Cookbooks
The following cookbooks are dependencies:
- apt
- openssl
- osops-utils
- yum
Resources/Providers
virtual_server
Example:
haproxy_virtual_server "web" do
lb_algo "leastconn"
vs_listen_ip "192.168.100.10"
vs_listen_port "80"
real_servers [{"ip" => "192.168.100.11", "port" => "80"}, {"ip" => "192.168.100.12", "port" => "80}]
end
lb_algo
options are roundrobin
, leastconn
, source
, defaults to roundrobin
configsingle
Example:
haproxy_configsingle "ec2-api" do
action :create
servers(
"foo1" => {"host" => "1.2.3.4", "port" => "8774"},
"foo2" => {"host" => "5.6.7.8", "port" => "8774"}
)
listen "0.0.0.0"
listen_port "4568"
notifies :restart, resources(:service => "haproxy"), :immediately
end
config
Example:
haproxy_config "api" do
role "myrole"
namespace "mynamespace"
service "myservice"
end
# delete a config from haproxy.d
haproxy_config "some-api" do
action :delete
notifies :restart, resources(:service => "haproxy"), :immediately
end
Recipes
default
The default recipe will install haproxy with a generic haproxy.cfg configuration
Attributes
haproxy["admin_port"]
- Admin port for haproxy statistics pagehaproxy["admin_password"]
- Admin password for haproxy statistics page (defaults topassword
whennode["developer_mode"] = true
)
Templates
haproxy.cfg.erb
- Config for haproxy serverhaproxy-default.cfg.erb
- Config for upstart/init defaults on debian familyhaproxy-new.cfg.erb
- Config for haproxy.d configurationsvs_generic.cfg.erb
- Config for virtual servers
License and Author
Author:: Justin Shepherd ([email protected])
Author:: Jason Cannavale ([email protected])
Author:: Ron Pedde ([email protected])
Author:: Joseph Breu ([email protected])
Author:: William Kelly ([email protected])
Author:: Darren Birkett ([email protected])
Author:: Evan Callicoat ([email protected])
Author:: Matt Thompson ([email protected])
Author:: Chris Laco ([email protected])
Copyright 2012-2013, Rackspace US, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.