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

refs #11737 - support cnames and add localhost cname to qpid certs #65

Merged
merged 1 commit into from
Oct 20, 2016
Merged
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
10 changes: 10 additions & 0 deletions lib/puppet/provider/cert/katello_ssl_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def generate!
'--server-cert-req', File.basename(req_file),
'--server-key', File.basename(privkey),
'--server-rpm', rpmfile_base_name ]

if resource[:custom_pubkey]
FileUtils.mkdir_p(build_path)
FileUtils.cp(resource[:custom_pubkey], build_path(File.basename(pubkey)))
Expand All @@ -25,6 +26,15 @@ def generate!
'--ca-key', ca_details[:privkey]])
args.concat(common_args)
end

if resource[:cname]
if resource[:cname].is_a?(String)
args << ['--set-cname', resource[:cname]]
else
args << resource[:cname].map { |cname| ['--set-cname', cname] }.flatten
end
end

katello_ssl_tool(*args)
super
end
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/type/certs_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ module Certs

newparam(:common_name)

newparam(:cname)

newparam(:email)

newparam(:country)
Expand Down
4 changes: 2 additions & 2 deletions manifests/candlepin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
mode => '0750',
} ~>
exec { 'create candlepin qpid exchange':
command => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://${::fqdn}:5671' add exchange topic ${certs::candlepin_qpid_exchange} --durable",
unless => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://${::fqdn}:5671' exchanges ${certs::candlepin_qpid_exchange}",
command => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://localhost:5671' add exchange topic ${certs::candlepin_qpid_exchange} --durable",
unless => "qpid-config --ssl-certificate ${client_cert} --ssl-key ${client_key} -b 'amqps://localhost:5671' exchanges ${certs::candlepin_qpid_exchange}",
require => Service['qpidd'],
} ~>
exec { 'import CA into Candlepin truststore':
Expand Down
1 change: 1 addition & 0 deletions manifests/qpid.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
cert { $qpid_cert_name:
ensure => present,
hostname => $::certs::qpid::hostname,
cname => 'localhost',
country => $::certs::country,
state => $::certs::state,
city => $::certs::city,
Expand Down