diff --git a/chef/cookbooks/ceph/recipes/mon.rb b/chef/cookbooks/ceph/recipes/mon.rb index 80f32f2..4961716 100644 --- a/chef/cookbooks/ceph/recipes/mon.rb +++ b/chef/cookbooks/ceph/recipes/mon.rb @@ -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" @@ -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" @@ -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 @@ -187,3 +200,37 @@ end end end + + +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 diff --git a/chef/cookbooks/ceph/recipes/radosgw_keystone.rb b/chef/cookbooks/ceph/recipes/radosgw_keystone.rb index 68bbcd3..b63cdad 100644 --- a/chef/cookbooks/ceph/recipes/radosgw_keystone.rb +++ b/chef/cookbooks/ceph/recipes/radosgw_keystone.rb @@ -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" @@ -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 @@ -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 @@ -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" diff --git a/chef/cookbooks/ceph/templates/default/ceph.conf.erb b/chef/cookbooks/ceph/templates/default/ceph.conf.erb index 6d5501c..981d198 100644 --- a/chef/cookbooks/ceph/templates/default/ceph.conf.erb +++ b/chef/cookbooks/ceph/templates/default/ceph.conf.erb @@ -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 diff --git a/crowbar_framework/app/models/ceph_service.rb b/crowbar_framework/app/models/ceph_service.rb index 5cb2ede..a06a7a9 100644 --- a/crowbar_framework/app/models/ceph_service.rb +++ b/crowbar_framework/app/models/ceph_service.rb @@ -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", @@ -59,7 +59,7 @@ def role_constraints "unique" => false, "count" => 9, "platform" => { - "suse" => "<= 12.2", + "suse" => "<= 12.3", "opensuse" => "/.*/" }, "conflicts_with" => ["ceph-calamari"] @@ -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"] @@ -77,7 +77,7 @@ def role_constraints "unique" => false, "count" => 1, "platform" => { - "suse" => "<= 12.2", + "suse" => "<= 12.3", "opensuse" => "/.*/" }, "cluster" => true, @@ -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"]