fixed a haproxy bug

Change-Id: I88829323e6b7d500710a544c6a893afb2befb466
This commit is contained in:
SamSu 2014-03-26 12:20:30 -07:00
parent 66177e0196
commit 8728a7223e
5 changed files with 18 additions and 12 deletions

View File

@ -79,7 +79,7 @@ default['haproxy']['source']['use_pcre'] = false
default['haproxy']['source']['use_openssl'] = false
default['haproxy']['source']['use_zlib'] = false
default['haproxy']['enable_services'] = []
default['haproxy']['enabled_services'] = []
default['haproxy']['listeners'] = {
'listen' => {},
@ -99,8 +99,8 @@ default['haproxy']['services'] = {
"mode http", \
"option forwardfor", \
"option httpchk", \
"option httpclose"
# "rspidel ^Set-cookie:\ IP="
"option httpclose", \
'rspidel ^Set-cookie:\ IP='
]
},
"dashboard_https" => {

View File

@ -34,23 +34,24 @@ mydata = data_bag_item(defaultbag, myitem)
if mydata['ha']['status'].eql?('enable')
node.set['haproxy']['incoming_address'] = mydata['ha']['haproxy']['vip']
#services = node['haproxy']['enabled_services'].clone
mydata['ha']['haproxy']['roles'].each do |role, services|
services.each do |service|
node.set['haproxy']['services'][service]['role'] = role
unless node['haproxy']['enable_services'].include?(service)
node.set['haproxy']['enable_services'] << service
unless node['haproxy']['enabled_services'].include?(service)
# node['haproxy']['enabled_services'] << service
node.set['haproxy']['enabled_services'] = node['haproxy']['enabled_services'] + [service]
end
end
end
end
node['haproxy']['services'].each do |name, service|
unless node['haproxy']['enable_services'].include?(name)
unless node['haproxy']['enabled_services'].include?(name)
next
end
pool_members = search("node", "role:#{service['role']} AND chef_environment:#{node.chef_environment}") || []
pool_members = search(:node, "run_list:role\\[#{service['role']}\\] AND chef_environment:#{node.chef_environment}") || []
# load balancer may be in the pool
pool_members << node if node.run_list.roles.include?(service[:role])

View File

@ -77,6 +77,12 @@ node['openstack']['services'].each_key do |service|
end
end
if mydata['ha']['status'].eql?('enable')
node.set["openstack"]["identity"]["bind_interface"] = mydata['networking']['control']['interface']
node.set["openstack"]["image"]["api"]["bind_interface"] = mydata['networking']['control']['interface']
node.set["openstack"]["image"]["registry"]["bind_interface"] = mydata['networking']['control']['interface']
node.set["openstack"]["network"]["api"]["bind_interface"] = mydata['networking']['control']['interface']
end
# network plugins
node.override["openstack"]["network"]["plugins"] = ['openvswitch', 'openvswitch-agent']

View File

@ -38,7 +38,7 @@ default["openstack"]["dashboard"]["keystone_default_role"] = "Member"
default["openstack"]["dashboard"]["keystone_service_chef_role"] = "keystone"
default["openstack"]["dashboard"]["server_hostname"] = nil
default["openstack"]["dashboard"]["use_ssl"] = true
default["openstack"]["dashboard"]["use_ssl"] = false
default["openstack"]["dashboard"]["ssl"]["cert"] = "horizon.pem"
default["openstack"]["dashboard"]["ssl"]["key"] = "horizon.key"

View File

@ -36,8 +36,7 @@ log_config = /etc/openstack/logging.conf
# publish_errors = False
# Address to bind the API server
# bind_host = <%= @bind_address %>
bind_host = <%= node['openstack']['endpoints']['network-api']['host'] %>
bind_host = <%= @bind_address %>
# Port the bind the API server to
bind_port = <%= @bind_port %>