default["ceph"]["radosgw"]["admin_email"] = "admin@example.com"
default["ceph"]["radosgw"]["rgw_addr"] = "*:80"
default["ceph"]["radosgw"]["rgw_port"] = false
+default["ceph"]["radosgw"]["webserver_companion"] = "apache2" #can be false
# See the License for the specific language governing permissions and
# limitations under the License.
-include_recipe "apache2"
-
packages = %w{
- radosgw
- libapache2-mod-fastcgi
+ radosgw
}
if node['ceph']['install_debug']
end
packages.each do |pkg|
- package pkg do
- action :upgrade
- end
+ package pkg do
+ action :upgrade
+ end
end
cookbook_file "/etc/init.d/radosgw" do
- source "radosgw"
- mode 0755
- owner "root"
- group "root"
+ source "radosgw"
+ mode 0755
+ owner "root"
+ group "root"
end
service "radosgw" do
- service_name "radosgw"
- supports :restart => true
- action[:enable,:start]
-end
-
-apache_module "fastcgi" do
- conf true
-end
-
-apache_module "rewrite" do
- conf false
-end
-
-template "/etc/apache2/sites-available/rgw.conf" do
- source "rgw.conf.erb"
- mode 0400
- owner "root"
- group "root"
- variables(
- :ceph_api_fqdn => node['ceph']['radosgw']['api_fqdn'],
- :ceph_admin_email => node['ceph']['radosgw']['admin_email'],
- :ceph_rgw_addr => node['ceph']['radosgw']['rgw_addr']
- )
- if ::File.exists?("#{node['apache']['dir']}/sites-enabled/rgw.conf")
- notifies :restart, "service[apache2]"
- end
+ service_name "radosgw"
+ supports :restart => true
+ action[:enable,:start]
end
-apache_site "rgw.conf" do
- enable enable_setting
+if node["ceph"]["radosgw"]["webserver_companion"]
+ include_recipe "ceph::radosgw_#{node["ceph"]["radosgw"]["webserver_companion"]}"
end
-
--- /dev/null
+#
+# Author:: Kyle Bader <kyle.bader@dreamhost.com>
+# Cookbook Name:: ceph
+# Recipe:: radosgw_apache2
+#
+# Copyright 2011, DreamHost Web Hosting
+#
+# 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 "apache2"
+include_recipe "apache2::mod_fastcgi"
+
+apache_module "rewrite" do
+ conf false
+end
+
+web_app "rgw" do
+ template "rgw.conf.erb"
+ server_name node['ceph']['radosgw']['api_fqdn']
+ admin_email node['ceph']['radosgw']['admin_email']
+ ceph_rgw_addr node['ceph']['radosgw']['rgw_addr']
+end
<% if node['ceph']['radosgw']['rgw_port'] -%>
FastCgiExternalServer /var/www/dummyradosgw.fcgi -host 127.0.0.1:<%= node['ceph']['radosgw']['rgw_port'] %>
<% else -%>
-FastCgiExternalServer /var/www/dummyradosgw.fcgi -socket /var/run/ceph/radosgw.client.radosgw.<%= node[:hostname] %>
+FastCgiExternalServer /var/www/dummyradosgw.fcgi -socket /var/run/ceph/radosgw.client.radosgw.<%= node['hostname'] %>
<% end -%>
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" proxy_combined
LogFormat "%{X-Forwarded-For}i %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" proxy_debug
-<VirtualHost <%= @ceph_rgw_addr %>>
- ServerName <%= @ceph_api_fqdn %>
- ServerAdmin <%= @ceph_admin_email %>
+<VirtualHost <%= node['ceph']['radosgw']['rgw_addr'] %>>
+ ServerName <%= @params[:server_name] %>
+ ServerAdmin <%= node["ceph"]["radosgw"]["admin_email"] %>
DocumentRoot /var/www/
RewriteEngine On