Fix rubocop 1
This commit is contained in:
parent
c14d066a36
commit
4959c4f9a5
@ -24,7 +24,7 @@ if node['roles'].include?("ceph-radosgw") \
|
|||||||
&& node["ceph"]["radosgw"]["webserver_companion"] == "apache2" \
|
&& node["ceph"]["radosgw"]["webserver_companion"] == "apache2" \
|
||||||
&& node["ceph"]["radosgw"]["use_apache_fork"] == true
|
&& node["ceph"]["radosgw"]["use_apache_fork"] == true
|
||||||
case node['lsb']['codename']
|
case node['lsb']['codename']
|
||||||
when "precise","oneiric"
|
when "precise", "oneiric"
|
||||||
apt_repository "ceph-apache2" do
|
apt_repository "ceph-apache2" do
|
||||||
repo_name "ceph-apache2"
|
repo_name "ceph-apache2"
|
||||||
uri "http://gitbuilder.ceph.com/apache2-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
|
uri "http://gitbuilder.ceph.com/apache2-deb-#{node['lsb']['codename']}-x86_64-basic/ref/master"
|
||||||
|
@ -29,17 +29,16 @@ ceph_client name do
|
|||||||
as_keyring false
|
as_keyring false
|
||||||
end
|
end
|
||||||
|
|
||||||
mons = get_mon_addresses()
|
mons = get_mon_addresses.join(",") + ":/"
|
||||||
mons = mons.join(",")
|
|
||||||
mons = mons + ":/"
|
directory node['ceph']['cephfs_mount']
|
||||||
if not mons.empty?
|
|
||||||
directory node['ceph']['cephfs_mount']
|
mount node['ceph']['cephfs_mount'] do
|
||||||
mount node['ceph']['cephfs_mount'] do
|
fstype "ceph"
|
||||||
fstype "ceph"
|
device mons
|
||||||
device mons
|
options "_netdev,name=#{client_name},secretfile=#{filename}"
|
||||||
options "_netdev,name=#{client_name},secretfile=#{filename}"
|
dump 0
|
||||||
dump 0
|
pass 0
|
||||||
pass 0
|
action [:mount, :enable]
|
||||||
action [:mount, :enable]
|
not_if { mons.empty? }
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
raise "fsid must be set in config" if node["ceph"]["config"]['fsid'].nil?
|
fail "fsid must be set in config" if node["ceph"]["config"]['fsid'].nil?
|
||||||
raise "mon_initial_members must be set in config" if node["ceph"]["config"]['mon_initial_members'].nil?
|
fail "mon_initial_members must be set in config" if node["ceph"]["config"]['mon_initial_members'].nil?
|
||||||
|
|
||||||
mon_addresses = get_mon_addresses()
|
mon_addresses = get_mon_addresses
|
||||||
|
|
||||||
is_rgw = false
|
is_rgw = node['roles'].include?('ceph-radosgw')
|
||||||
if node['roles'].include? 'ceph-radosgw'
|
|
||||||
is_rgw = true
|
|
||||||
end
|
|
||||||
|
|
||||||
directory "/etc/ceph" do
|
directory "/etc/ceph" do
|
||||||
owner "root"
|
owner "root"
|
||||||
|
@ -16,5 +16,5 @@
|
|||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
include_recipe "ceph::default"
|
include_recipe "ceph::default"
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
# this recipe allows bootstrapping new osds, with help from mon
|
# this recipe allows bootstrapping new osds, with help from mon
|
||||||
# Sample environment:
|
# Sample environment:
|
||||||
# #knife node edit ceph1
|
# #knife node edit ceph1
|
||||||
#"osd_devices": [
|
# "osd_devices": [
|
||||||
# {
|
# {
|
||||||
# "device": "/dev/sdc"
|
# "device": "/dev/sdc"
|
||||||
# },
|
# },
|
||||||
@ -29,7 +29,7 @@
|
|||||||
# "dmcrypt": true,
|
# "dmcrypt": true,
|
||||||
# "journal": "/dev/sdd"
|
# "journal": "/dev/sdd"
|
||||||
# }
|
# }
|
||||||
#]
|
# ]
|
||||||
|
|
||||||
include_recipe "ceph::default"
|
include_recipe "ceph::default"
|
||||||
include_recipe "ceph::conf"
|
include_recipe "ceph::conf"
|
||||||
@ -38,16 +38,15 @@ package 'gdisk' do
|
|||||||
action :upgrade
|
action :upgrade
|
||||||
end
|
end
|
||||||
|
|
||||||
if !search(:node,"hostname:#{node['hostname']} AND dmcrypt:true").empty?
|
package 'cryptsetup' do
|
||||||
package 'cryptsetup' do
|
action :upgrade
|
||||||
action :upgrade
|
not_if { search(:node,"hostname:#{node['hostname']} AND dmcrypt:true").empty? }
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
service_type = node["ceph"]["osd"]["init_style"]
|
service_type = node["ceph"]["osd"]["init_style"]
|
||||||
mons = node['ceph']['encrypted_data_bags'] ? get_mon_nodes : get_mon_nodes("ceph_bootstrap_osd_key:*")
|
mons = node['ceph']['encrypted_data_bags'] ? get_mon_nodes : get_mon_nodes("ceph_bootstrap_osd_key:*")
|
||||||
|
|
||||||
if mons.empty? then
|
if mons.empty?
|
||||||
puts "No ceph-mon found."
|
puts "No ceph-mon found."
|
||||||
else
|
else
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ else
|
|||||||
mode "0755"
|
mode "0755"
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO cluster name
|
# TODO: cluster name
|
||||||
cluster = 'ceph'
|
cluster = 'ceph'
|
||||||
|
|
||||||
osd_secret = if node['ceph']['encrypted_data_bags']
|
osd_secret = if node['ceph']['encrypted_data_bags']
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
case node['platform_family']
|
case node['platform_family']
|
||||||
when "debian","suse"
|
when "debian", "suse"
|
||||||
packages = %w{
|
packages = %w{
|
||||||
apache2
|
apache2
|
||||||
libapache2-mod-fastcgi
|
libapache2-mod-fastcgi
|
||||||
}
|
}
|
||||||
when "rhel","fedora"
|
when "rhel", "fedora"
|
||||||
packages = %w{
|
packages = %w{
|
||||||
httpd
|
httpd
|
||||||
mod_fastcgi
|
mod_fastcgi
|
||||||
|
@ -4,5 +4,5 @@ when "debian"
|
|||||||
when "rhel", "suse"
|
when "rhel", "suse"
|
||||||
include_recipe "ceph::rpm"
|
include_recipe "ceph::rpm"
|
||||||
else
|
else
|
||||||
raise "not supported"
|
fail "not supported"
|
||||||
end
|
end
|
||||||
|
@ -2,10 +2,10 @@ actions :add
|
|||||||
default_action :add
|
default_action :add
|
||||||
|
|
||||||
attribute :name, :kind_of => String, :name_attribute => true
|
attribute :name, :kind_of => String, :name_attribute => true
|
||||||
attribute :caps, :kind_of => Hash, :default => {"mon"=>"allow r", "osd"=>"allow r"}
|
attribute :caps, :kind_of => Hash, :default => {"mon" => "allow r", "osd" => "allow r"}
|
||||||
|
|
||||||
# Whether to store the secret in a keyring file or a plain secret file
|
# Whether to store the secret in a keyring file or a plain secret file
|
||||||
attribute :as_keyring, :kind_of => [TrueClass,FalseClass], :default => true
|
attribute :as_keyring, :kind_of => [TrueClass, FalseClass], :default => true
|
||||||
|
|
||||||
# what the key should be called in the ceph cluster
|
# what the key should be called in the ceph cluster
|
||||||
# defaults to client.#{name}.#{hostname}
|
# defaults to client.#{name}.#{hostname}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user