Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow nss db files to be created for keystone integration #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions attributes/radosgw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
default["ceph"]["radosgw"]["rgw_addr"] = "*:80"
default["ceph"]["radosgw"]["rgw_port"] = false
default["ceph"]["radosgw"]["webserver_companion"] = "apache2" #can be false
default["ceph"]["radosgw"]["process_owner"] = node['apache']['user']
default['ceph']["radosgw"]['use_apache_fork'] = true
case node['platform']
when 'ubuntu'
Expand Down
31 changes: 29 additions & 2 deletions recipes/radosgw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
case node['platform_family']
when "debian"
packages = %w{
radosgw
radosgw libnss3-tools
}

if node['ceph']['install_debug']
Expand All @@ -31,7 +31,7 @@
end
when "rhel","fedora","suse"
packages = %w{
ceph-radosgw
ceph-radosgw nss-tools
}
end

Expand All @@ -43,6 +43,33 @@

include_recipe "ceph::conf"

if !(node["ceph"]["radosgw"]["keystone_ca"].nil? || node["ceph"]["radosgw"]["keystone_signing"].nil? || node["ceph"]["config"]["rgw"]["nss db path"].nil?)
directory "#{node['ceph']['config']['rgw']['nss db path']}" do
owner "root"
group "root"
mode 0755
recursive true
action :create
end
unless (File.exists?("#{node['ceph']['config']['rgw']['nss db path']}/cert8.db") && File.exists?("#{node['ceph']['config']['rgw']['nss db path']}/key3.db") && File.exists?("#{node['ceph']['config']['rgw']['nss db path']}/secmod.db"))
execute "keystone-ca certutil" do
command "openssl x509 -in #{node['ceph']['radosgw']['keystone_ca']} -pubkey | certutil -d #{node['ceph']['config']['rgw']['nss db path']} -A -n ca -t 'TCu,Cu,Tuw'"
end
execute "keystone-signing certutil" do
command "openssl x509 -in #{node['ceph']['radosgw']['keystone_signing']} -pubkey | certutil -A -d #{node['ceph']['config']['rgw']['nss db path']} -n signing_cert -t 'P,P,P'"
end
end
file "#{node['ceph']['config']['rgw']['nss db path']}/cert8.db" do
owner node['ceph']['radosgw']['process_owner']
end
file "#{node['ceph']['config']['rgw']['nss db path']}/key3.db" do
owner node['ceph']['radosgw']['process_owner']
end
file "#{node['ceph']['config']['rgw']['nss db path']}/secmod.db" do
owner node['ceph']['radosgw']['process_owner']
end
end

unless File.exists?("/var/lib/ceph/radosgw/ceph-radosgw.#{node['hostname']}/done")
if node["ceph"]["radosgw"]["webserver_companion"]
include_recipe "ceph::radosgw_#{node["ceph"]["radosgw"]["webserver_companion"]}"
Expand Down