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 #8756: Deploy the server_ca to the Capsule directories for RHSM. #44

Merged
merged 1 commit into from Jan 21, 2015
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -104,5 +104,3 @@ certificates are located in `/etc/pki/katello-certs-tools/` directory
##Development

See the CONTRIBUTING guide for steps on how to make a change and get it accepted upstream.

>>>>>>> Refs #6736: Updates to standard layout and basic test.
13 changes: 13 additions & 0 deletions manifests/init.pp
Expand Up @@ -123,6 +123,8 @@
$ca_key_password = cache_data('ca_key_password', generate_password())
$ca_key_password_file = "${certs::pki_dir}/private/${default_ca_name}.pwd"

$katello_server_ca_cert = "${certs::pki_dir}/certs/${server_ca_name}.crt"

class { 'certs::install': } ->
class { 'certs::config': } ->
file { $ca_key_password_file:
Expand Down Expand Up @@ -190,6 +192,17 @@
mode => '0644',
}

Ca[$server_ca_name] ~>
pubkey { $katello_server_ca_cert:
key_pair => $server_ca
} ~>
file { $katello_server_ca_cert:
ensure => file,
owner => 'root',
group => $certs::group,
mode => '0644',
}

if $generate {
Ca[$default_ca_name] ~>
privkey { $ca_key:
Expand Down
14 changes: 7 additions & 7 deletions manifests/katello.pp
Expand Up @@ -16,18 +16,19 @@
$candlepin_consumer_name = "katello-ca-consumer-${::fqdn}"
$candlepin_consumer_summary = "Subscription-manager consumer certificate for Katello instance ${::fqdn}"
$candlepin_consumer_description = 'Consumer certificate and post installation script that configures rhsm.'

file { $katello_www_pub_dir:
ensure => directory,
owner => 'apache',
group => 'apache',
mode => '0755',
} ->
# Placing the CA in the pub dir for trusting by a user in their browser
file { "${katello_www_pub_dir}/${certs::default_ca_name}.crt":
file { "${katello_www_pub_dir}/${certs::server_ca_name}.crt":
ensure => present,
source => "${certs::ssl_build_dir}/${certs::default_ca_name}.crt",
owner => 'apache',
group => 'apache',
source => "${certs::pki_dir}/certs/${certs::server_ca_name}.crt",
owner => 'root',
group => 'root',
mode => '0644',
} ->
# We need to deliver the server_ca for yum and rhsm to trust the server
Expand All @@ -36,10 +37,9 @@
dir => $katello_www_pub_dir,
summary => $candlepin_consumer_summary,
description => $candlepin_consumer_description,
files => ["${rhsm_ca_dir}/candlepin-local.pem:644=${certs::ssl_build_dir}/${certs::default_ca_name}.crt",
"${rhsm_ca_dir}/katello-server-ca.pem:644 =${certs::ssl_build_dir}/${certs::server_ca_name}.crt"],
files => ["${rhsm_ca_dir}/katello-server-ca.pem:644 =${certs::pki_dir}/certs/${certs::server_ca_name}.crt"],
Copy link
Member

Choose a reason for hiding this comment

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

Is this change compatible with katello-agent https://github.com/Katello/katello-agent/blob/master/etc/gofer/plugins/katelloplugin.conf. Btw. default_ca != server_ca, it's only coincidence they are the same, when using self-signed generated certs, but are different when using custom certs for ssl.

Copy link
Member

Choose a reason for hiding this comment

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

Discussed w/ @iNecas on IRC and it appears this breaks the agent with custom certs. RHSM would be using the server_ca but qpid-dispatch-router would be using default_ca.

Copy link
Member

Choose a reason for hiding this comment

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

The BZ describing the issue is here https://bugzilla.redhat.com/show_bug.cgi?id=1222912

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok... so lets get a Redmine issue and fix it :)

bootstrap_script => template('certs/rhsm-katello-reconfigure.erb'),
alias => $candlepin_cert_rpm_alias,
subscribe => $::certs::server_ca;
subscribe => $::certs::server_ca,
}
}