xiaodongwang a8bfd97de2 make openstack installation support proxy mode
Change-Id: I3d6ce9418aa4763020cc38699dbcc784b4b7c013
2015-02-08 13:19:06 -08:00

57 lines
1.4 KiB
Ruby

#
# Cookbook Name:: haproxy
# Recipe:: default
#
# Copyright 2009, Opscode, 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.
#
include_recipe 'build-essential'
package 'libpcre3-dev' do
only_if { node['haproxy']['source']['use_pcre'] }
end
package 'libssl-dev' do
only_if { node['haproxy']['source']['use_openssl'] }
end
package 'zlib1g-dev' do
only_if { node['haproxy']['source']['use_zlib'] }
end
node.set['haproxy']['conf_dir'] = "#{node['haproxy']['source']['prefix']}/etc"
package 'haproxy'
user "haproxy" do
comment "haproxy system account"
system true
shell "/bin/false"
end
directory node['haproxy']['conf_dir']
template "/etc/init.d/haproxy" do
source "haproxy-init.erb"
owner "root"
group "root"
mode 00755
variables(
:hostname => node['hostname'],
:conf_dir => node['haproxy']['conf_dir'],
:prefix => node['haproxy']['source']['prefix']
)
end