]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cookbooks.git/commitdiff
Update radosgw_apache2 recipe 33/head
authorAlexandre Marangone <alexandre.marangone@inktank.com>
Tue, 23 Apr 2013 19:13:21 +0000 (12:13 -0700)
committerAlexandre Marangone <alexandre.marangone@inktank.com>
Tue, 4 Jun 2013 17:44:35 +0000 (10:44 -0700)
- 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>
recipes/radosgw_apache2.rb

index c6c23a33c6320eeb4a575fb93afbc86d56dde3ea..080c3770b359fefaa1ac4ccbd3e41ecbb49a0563 100644 (file)
 # 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