default['ceph']['encrypted_data_bags'] = false
default['ceph']['install_repo'] = true
+
+case node['platform']
+when 'ubuntu'
+ default['ceph']['init_style'] = 'upstart'
+else
+ default['ceph']['init_style'] = 'sysvinit'
+end
+
+case node['platform_family']
+when 'debian'
+ packages = ['ceph-common']
+ packages += debug_packages(packages) if node['ceph']['install_debug']
+ default['ceph']['packages'] = packages
+when 'rhel', 'fedora'
+ packages = ['ceph']
+ packages += debug_packages(packages) if node['ceph']['install_debug']
+ default['ceph']['packages'] = packages
+else
+ default['ceph']['packages'] = []
+end
-case node['platform']
-when 'ubuntu'
- default['ceph']['mds']['init_style'] = 'upstart'
+include_attribute 'ceph'
+
+default['ceph']['mds']['init_style'] = node['init_style']
+
+case node['platform_family']
+when 'debian'
+ packages = ['ceph-mds']
+ packages += debug_packages(packages) if node['ceph']['install_debug']
+ default['ceph']['mds']['packages'] = packages
else
- default['ceph']['mds']['init_style'] = 'sysvinit'
+ default['ceph']['mds']['packages'] = []
end
-case node['platform']
-when 'ubuntu'
- default['ceph']['mon']['init_style'] = 'upstart'
+include_attribute 'ceph'
+
+default['ceph']['mon']['init_style'] = node['ceph']['init_style']
+
+default['ceph']['mon']['secret_file'] = '/etc/chef/secrets/ceph_mon'
+
+case node['platform_family']
+when 'debian', 'rhel', 'fedora'
+ packages = ['ceph']
+ packages += debug_packages(packages) if node['ceph']['install_debug']
+ default['ceph']['mon']['packages'] = packages
else
- default['ceph']['mon']['init_style'] = 'sysvinit'
+ default['ceph']['mon']['packages'] = []
end
-default['ceph']['mon']['secret_file'] = '/etc/chef/secrets/ceph_mon'
-case node['platform']
-when 'ubuntu'
- default['ceph']['osd']['init_style'] = 'upstart'
+include_attribute 'ceph'
+
+default['ceph']['osd']['init_style'] = node['ceph']['init_style']
+
+default['ceph']['osd']['secret_file'] = '/etc/chef/secrets/ceph_osd'
+
+case node['platform_family']
+when 'debian', 'rhel', 'fedora'
+ packages = ['ceph']
+ packages += debug_packages(packages) if node['ceph']['install_debug']
+ default['ceph']['osd']['packages'] = packages
else
- default['ceph']['osd']['init_style'] = 'sysvinit'
+ default['ceph']['osd']['packages'] = []
end
-default['ceph']['osd']['secret_file'] = '/etc/chef/secrets/ceph_osd'
# limitations under the License.
#
+include_attribute 'ceph'
+
default['ceph']['radosgw']['api_fqdn'] = 'localhost'
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
default['ceph']['radosgw']['use_apache_fork'] = true
-case node['platform']
-when 'ubuntu'
- default['ceph']['radosgw']['init_style'] = 'upstart'
+default['ceph']['radosgw']['init_style'] = node['ceph']['init_style']
+
+case node['platform_family']
+when 'debian'
+ packages = ['radosgw']
+ packages += debug_packages(packages) if node['ceph']['install_debug']
+ default['ceph']['radosgw']['packages'] = packages
+when 'rhel', 'fedora', 'suse'
+ default['ceph']['radosgw']['packages'] = ['ceph-radosgw']
else
- default['ceph']['radosgw']['init_style'] = 'sysvinit'
+ default['ceph']['radosgw']['packages'] = []
end
--- /dev/null
+case node['platform_family']
+when 'debian', 'suse'
+ default['ceph']['radosgw']['apache2']['packages'] = ['libapache2-mod-fastcgi']
+when 'rhel', 'fedora'
+ default['ceph']['radosgw']['apache2']['packages'] = ['mod_fastcgi']
+end
--- /dev/null
+def debug_packages(packages)
+ packages.map { |x| x + debug_ext }
+end
+
+def debug_ext
+ case node['platform_family']
+ when 'debian'
+ '-dbg'
+ when 'rhel', 'fedora'
+ '-debug'
+ else
+ ''
+ end
+end
+include_recipe 'ceph::_common_install'
-include_recipe 'ceph::repo' if node['ceph']['install_repo']
+# Tools needed by cookbook
+node['ceph']['packages'].each do |pck|
+ package pck
+end
--- /dev/null
+include_recipe 'ceph::repo' if node['ceph']['install_repo']
key node['ceph']['debian']['extras']['repository_key']
only_if { node['ceph']['extras_repo'] }
end
-
-if node['ceph']['is_radosgw'] \
- && node['ceph']['radosgw']['webserver_companion'] == 'apache2' \
- && node['ceph']['radosgw']['use_apache_fork'] == true
- case node['lsb']['codename']
- when 'precise', 'oneiric'
- apt_repository 'ceph-apache2' do
- repo_name 'ceph-apache2'
- uri "http://gitbuilder.ceph.com/apache2-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
- distribution distribution_codename
- components ['main']
- key 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
- end
- apt_repository 'ceph-modfastcgi' do
- repo_name 'ceph-modfastcgi'
- uri "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
- distribution distribution_codename
- components ['main']
- key 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
- end
- else
- Log.info("Ceph's Apache and Apache FastCGI forks not available for this distribution")
- end
-end
+++ /dev/null
-#
-# Author:: Kyle Bader <kyle.bader@dreamhost.com>
-# Cookbook Name:: ceph
-# Recipe:: default
-#
-# 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.
-
-packages = []
-
-case node['platform_family']
-when 'debian'
- packages = %w(
- ceph
- ceph-common
- )
-
- if node['ceph']['install_debug']
- packages_dbg = %w(
- ceph-dbg
- ceph-common-dbg
- )
- packages += packages_dbg
- end
-when 'rhel', 'fedora'
- packages = %w(
- ceph
- )
-
- if node['ceph']['install_debug']
- packages_dbg = %w(
- ceph-debug
- )
- packages += packages_dbg
- end
-end
-
-packages.each do |pkg|
- package pkg do
- action :install
- end
-end
--- /dev/null
+#
+# Author:: Kyle Bader <kyle.bader@dreamhost.com>
+# Cookbook Name:: ceph
+# Recipe:: default
+#
+# 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.
+
+packages = []
+
+case node['platform_family']
+when 'debian'
+ packages = %w(
+ ceph
+ ceph-common
+ )
+
+ if node['ceph']['install_debug']
+ packages_dbg = %w(
+ ceph-dbg
+ ceph-common-dbg
+ )
+ packages += packages_dbg
+ end
+when 'rhel', 'fedora'
+ packages = %w(
+ ceph
+ )
+
+ if node['ceph']['install_debug']
+ packages_dbg = %w(
+ ceph-debug
+ )
+ packages += packages_dbg
+ end
+end
+
+packages.each do |pkg|
+ package pkg do
+ action :install
+ end
+end
# limitations under the License.
include_recipe 'ceph::_common'
-include_recipe 'ceph::default'
+include_recipe 'ceph::mds_install'
include_recipe 'ceph::conf'
cluster = 'ceph'
--- /dev/null
+include_recipe 'ceph::_common_install'
+
+node['ceph']['mds']['packages'].each do |pck|
+ package pck
+end
node.default['ceph']['is_mon'] = true
include_recipe 'ceph::_common'
-include_recipe 'ceph::default'
+include_recipe 'ceph::mon_install'
include_recipe 'ceph::conf'
service_type = node['ceph']['mon']['init_style']
--- /dev/null
+include_recipe 'ceph::_common_install'
+
+node['ceph']['mon']['packages'].each do |pck|
+ package pck
+end
# ]
include_recipe 'ceph::_common'
-include_recipe 'ceph::default'
+include_recipe 'ceph::osd_install'
include_recipe 'ceph::conf'
package 'gdisk' do
--- /dev/null
+include_recipe 'ceph::_common_install'
+
+node['ceph']['osd']['packages'].each do |pck|
+ package pck
+end
node.default['ceph']['is_radosgw'] = true
-case node['platform_family']
-when 'debian'
- packages = %w(
- radosgw
- )
-
- if node['ceph']['install_debug']
- packages_dbg = %w(
- radosgw-dbg
- )
- packages += packages_dbg
- end
-when 'rhel', 'fedora', 'suse'
- packages = %w(
- ceph-radosgw
- )
-end
-
-packages.each do |pkg|
- package pkg do
- action :upgrade
- end
-end
-
+include_recipe 'ceph::_common'
+include_recipe 'ceph::radosgw_install'
include_recipe 'ceph::conf'
if !::File.exist?("/var/lib/ceph/radosgw/ceph-radosgw.#{node['hostname']}/done")
# 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
+# 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
+
+include_recipe 'ceph::_common'
+include_recipe 'ceph::_common_install'
+include_recipe 'ceph::radosgw_apache2_repo'
-%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
+node['ceph']['radosgw']['apache2']['packages'].each do |pck|
+ package pck
end
include_recipe 'apache2'
--- /dev/null
+if node['ceph']['radosgw']['use_apache_fork'] == true
+ case node['lsb']['codename']
+ when 'precise', 'oneiric'
+ apt_repository 'ceph-apache2' do
+ repo_name 'ceph-apache2'
+ uri "http://gitbuilder.ceph.com/apache2-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
+ distribution distribution_codename
+ components ['main']
+ key 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
+ end
+ apt_repository 'ceph-modfastcgi' do
+ repo_name 'ceph-modfastcgi'
+ uri "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
+ distribution distribution_codename
+ components ['main']
+ key 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
+ end
+ else
+ Log.info("Ceph's Apache and Apache FastCGI forks not available for this distribution")
+ end
+end
+
--- /dev/null
+include_recipe 'ceph::_common_install'
+
+node['ceph']['radosgw']['packages'].each do |pck|
+ package pck
+end