Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions chef/cookbooks/ceph/recipes/mon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

mon_name = get_ceph_client_name(node)

package "ceph-mgr"
package "ceph-mon"
directory "/var/lib/ceph/mon/ceph-#{mon_name}" do
owner "ceph"
group "ceph"
Expand All @@ -30,6 +32,14 @@
action :create
end

directory "/var/lib/ceph/mgr/ceph-#{mon_name}" do
owner "ceph"
group "ceph"
mode "0750"
recursive true
action :create
end

# TODO cluster name
cluster = "ceph"

Expand Down Expand Up @@ -143,6 +153,9 @@
service "ceph-mon.target" do
action :enable
end
service "ceph-mgr.target" do
action :enable
end
service "ceph.target" do
action :enable
end
Expand Down Expand Up @@ -187,3 +200,37 @@
end
end
end


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/EmptyLines: Extra blank line detected. (https://github.com/bbatsov/ruby-style-guide#two-or-more-empty-lines)

unless File.exist?("/var/lib/ceph/mgr/ceph-#{mon_name}/done")
keyring = "/var/lib/ceph/mgr/#{cluster}-#{mon_name}/keyring"
execute "create mgr keyring" do
command "ceph auth get-or-create mgr.#{mon_name} \
mon 'allow profile mgr' osd 'allow *' mds 'allow *' \
-o #{keyring} && \
chown ceph.ceph #{keyring}"
not_if { File.exist?(keyring) }
end
ruby_block "finalise" do
block do
["done"].each do |ack|
File.open("/var/lib/ceph/mgr/ceph-#{mon_name}/#{ack}", "w").close
end
end
end
end

service "ceph_mgr" do
case service_type
when "upstart"
service_name "ceph-mgr-all-starter"
provider Chef::Provider::Service::Upstart
when "systemd"
service_name "ceph-mgr@#{mon_name}"
else
service_name "ceph"
end
supports restart: true, status: true
action [:enable, :start]
subscribes :restart, resources(template: "/etc/ceph/ceph.conf")
end
9 changes: 5 additions & 4 deletions chef/cookbooks/ceph/recipes/radosgw_keystone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
keystone_settings = KeystoneHelper.keystone_settings(node, @cookbook_name)
register_auth_hash = { user: keystone_settings["admin_user"],
password: keystone_settings["admin_password"],
tenant: keystone_settings["admin_tenant"] }
domain: keystone_settings["admin_domain"],
project: keystone_settings["admin_project"] }

crowbar_pacemaker_sync_mark "wait-radosgw_register"

Expand All @@ -25,7 +26,7 @@
auth register_auth_hash
user_name keystone_settings["service_user"]
user_password keystone_settings["service_password"]
tenant_name keystone_settings["service_tenant"]
project_name keystone_settings["service_tenant"]
action :add_user
end

Expand All @@ -36,7 +37,7 @@
port keystone_settings["admin_port"]
auth register_auth_hash
user_name keystone_settings["service_user"]
tenant_name keystone_settings["service_tenant"]
project_name keystone_settings["service_tenant"]
role_name "admin"
action :add_access
end
Expand Down Expand Up @@ -91,7 +92,7 @@
endpoint_publicURL "#{protocol}://#{public_host}:#{port}/swift/v1"
endpoint_adminURL "#{protocol}://#{admin_host}:#{port}/swift/v1"
endpoint_internalURL "#{protocol}://#{admin_host}:#{port}/swift/v1"
action :add_endpoint_template
action :add_endpoint
end

crowbar_pacemaker_sync_mark "create-radosgw_register"
Expand Down
3 changes: 2 additions & 1 deletion chef/cookbooks/ceph/templates/default/ceph.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
<% unless node[:ceph][:keystone_instance].nil? || node[:ceph][:keystone_instance].empty? || @keystone_settings.empty? -%>
rgw keystone url = <%= @keystone_settings['admin_auth_url'] %>
rgw keystone admin user = <%= @keystone_settings['service_user'] %>
rgw keystone admin tenant = <%= @keystone_settings['service_tenant'] %>
rgw keystone admin domain = <%= @keystone_settings['admin_domain'] %>
rgw keystone admin project = <%= @keystone_settings['admin_project'] %>
rgw keystone admin password = <%= @keystone_settings['service_password'] %>
<% if @keystone_settings['insecure'] -%>
rgw keystone verify ssl = false
Expand Down
10 changes: 5 additions & 5 deletions crowbar_framework/app/models/ceph_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def role_constraints
"unique" => false,
"count" => 1,
"platform" => {
"suse" => "<= 12.2",
"suse" => "<= 12.3",
"opensuse" => "/.*/"
},
"conflicts_with" => ["ceph-mds", "ceph-mon", "ceph-osd", "ceph-radosgw",
Expand All @@ -59,7 +59,7 @@ def role_constraints
"unique" => false,
"count" => 9,
"platform" => {
"suse" => "<= 12.2",
"suse" => "<= 12.3",
"opensuse" => "/.*/"
},
"conflicts_with" => ["ceph-calamari"]
Expand All @@ -68,7 +68,7 @@ def role_constraints
"unique" => false,
"count" => 150,
"platform" => {
"suse" => "<= 12.2",
"suse" => "<= 12.3",
"opensuse" => "/.*/"
},
"conflicts_with" => ["ceph-mds", "ceph-calamari"]
Expand All @@ -77,7 +77,7 @@ def role_constraints
"unique" => false,
"count" => 1,
"platform" => {
"suse" => "<= 12.2",
"suse" => "<= 12.3",
"opensuse" => "/.*/"
},
"cluster" => true,
Expand All @@ -87,7 +87,7 @@ def role_constraints
"unique" => false,
"count" => 3,
"platform" => {
"suse" => "<= 12.2",
"suse" => "<= 12.3",
"opensuse" => "/.*/"
},
"conflicts_with" => ["ceph-osd", "ceph-calamari"]
Expand Down