Update radosgw_apache2 recipe

- Multi distro support (CentOS/ubuntu tested)
- apache2::mod_fastcgi only supports Debian/Ubuntu, change it to
an apache_module
- Restart apache once new configuration is applied
- Add fastcgi script template

Signed-off-by: Alexandre Marangone <alexandre.marangone@inktank.com>
This commit is contained in:
Alexandre Marangone 2013-04-23 12:13:21 -07:00
parent 79566ef8ce
commit de36e7824a

View File

@ -17,8 +17,61 @@
# See the License for the specific language governing permissions and
# limitations under the License.
case node['platform_family']
when "debian","suse"
packages = %w{
apache2
libapache2-mod-fastcgi
}
when "rhel","fedora"
packages = %w{
httpd
mod_fastcgi
}
end
packages.each do |pkg|
package pkg do
action :upgrade
end
end
# For EL, delete the current fastcgi configuration
# and set the correct owners for dirs and logs
d_owner = d_group = "root"
if node['platform_family'] == "rhel"
file "#{node['apache']['dir']}/conf.d/fastcgi.conf" do
action :delete
backup false
end
d_owner = d_group = "apache"
end
%W{ /var/run/ceph
/var/lib/ceph/radosgw/ceph-radosgw.#{node['hostname']}
/var/lib/apache2/
}.each do |dir|
directory dir do
owner d_owner
group d_group
mode "0755"
recursive true
action :create
end
end
file "/var/log/ceph/radosgw.log" do
owner d_owner
group d_group
mode "0644"
action :create
end
include_recipe "apache2"
include_recipe "apache2::mod_fastcgi"
apache_module "fastcgi" do
conf true
end
apache_module "rewrite" do
conf false
@ -30,3 +83,17 @@ web_app "rgw" do
admin_email node['ceph']['radosgw']['admin_email']
ceph_rgw_addr node['ceph']['radosgw']['rgw_addr']
end
service "apache2" do
action :restart
end
template "/var/www/s3gw.fcgi" do
source "s3gw.fcgi.erb"
owner "root"
group "root"
mode "0755"
variables(
:ceph_rgw_client => "client.radosgw.#{node['hostname']}"
)
end