default['ceph']['cephfs_mount'] = '/ceph'
-default['ceph']['cephfs_use_fuse'] = nil # whether the recipe's fuse mount uses cephfs-fuse instead of kernel client, defaults to heuristics
+default['ceph']['cephfs_use_fuse'] = nil # whether the recipe's fuse mount uses cephfs-fuse instead of kernel client, defaults to heuristics
case node['platform_family']
when 'debian'
elsif node['ceph']['search_environment']
# search for any nodes with this environment
search_string += " AND chef_environment:#{node.chef_environment}"
- else
# search for any mon nodes
end
end
end
end
end
- mon_ips.reject { |m| m.nil? }.uniq
+ mon_ips.reject(&:nil?).uniq
end
def mon_secret
if @current_resource.exists
if @current_resource.keys_match && @current_resource.caps_match
- Chef::Log.info "Client #{ @new_resource } already exists and matches "\
+ Chef::Log.info "Client #{@new_resource} already exists and matches "\
'specifications - nothing to do.'
else
- converge_by("Recreating client #{ @new_resource } as existing doesn't "\
+ converge_by("Recreating client #{@new_resource} as existing doesn't "\
'match specifications') do
delete_entity(keyname)
create_entity(keyname)
end
end
else
- converge_by("Creating client #{ @new_resource }") do
+ converge_by("Creating client #{@new_resource}") do
create_entity(keyname)
end
end
mode mode
sensitive true if Chef::Resource::File.method_defined? :sensitive
end
-
end
def load_current_resource
action :create do
if @current_resource.exists
- Chef::Log.info "#{ @new_resource } already exists - nothing to do."
+ Chef::Log.info "#{@new_resource} already exists - nothing to do."
else
- converge_by("Creating #{ @new_resource }") do
+ converge_by("Creating #{@new_resource}") do
create_pool
end
end
action :delete do
if @current_resource.exists
- converge_by("Deleting #{ @new_resource }") do
+ converge_by("Deleting #{@new_resource}") do
delete_pool
end
else
- Chef::Log.info "#{ @current_resource } does not exist - nothing to do."
+ Chef::Log.info "#{@current_resource} does not exist - nothing to do."
end
end
cmd = Mixlib::ShellOut.new(cmd_text)
cmd.run_command
cmd.error!
- Chef::Log.debug "Pool created: #{ cmd.stderr }"
+ Chef::Log.debug "Pool created: #{cmd.stderr}"
end
def delete_pool
cmd = Mixlib::ShellOut.new(cmd_text)
cmd.run_command
cmd.error!
- Chef::Log.debug "Pool deleted: #{ cmd.stderr }"
+ Chef::Log.debug "Pool deleted: #{cmd.stderr}"
end
def pool_exists?(name)
cmd = Mixlib::ShellOut.new("ceph osd pool get #{name} size")
cmd.run_command
cmd.error!
- Chef::Log.debug "Pool exists: #{ cmd.stdout }"
+ Chef::Log.debug "Pool exists: #{cmd.stdout}"
true
rescue
- Chef::Log.debug "Pool doesn't seem to exist: #{ cmd.stderr }"
+ Chef::Log.debug "Pool doesn't seem to exist: #{cmd.stderr}"
false
end
if node['ceph']['osd_devices']
devices = node['ceph']['osd_devices']
- devices = Hash[(0...devices.size).zip devices] unless devices.kind_of? Hash
+ devices = Hash[(0...devices.size).zip devices] unless devices.is_a? Hash
devices.each do |index, osd_device|
unless osd_device['status'].nil?
if node['ceph']['radosgw']['use_apache_fork'] == true
if node.platform_family?('debian') &&
- %w(precise quantal raring saucy squeeze trusty wheezy).include?(node['lsb']['codename'])
+ %w(precise quantal raring saucy squeeze trusty wheezy).include?(node['lsb']['codename'])
apt_repository 'ceph-apache2' do
repo_name 'ceph-apache2'
uri "http://gitbuilder.ceph.com/apache2-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
key 'https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc'
end
elsif (node.platform_family?('fedora') && [18, 19].include?(node['platform_version'].to_i)) ||
- (node.platform_family?('rhel') && [6].include?(node['platform_version'].to_i))
+ (node.platform_family?('rhel') && [6].include?(node['platform_version'].to_i))
platform_family = node['platform_family']
platform_version = node['platform_version'].to_i
yum_repository 'ceph-apache2' do