Skip to content

Commit

Permalink
Move qpid client cert to /etc/pki/pulp
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Feb 15, 2019
1 parent efa768d commit 7d07cac
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
5 changes: 4 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
$katello_product = 'node-certs'
$katello_activation_key = undef

$messaging_client_cert = "${pki_dir}/qpid_client_striped.crt"
$pulp_pki_dir = '/etc/pki/pulp'

$qpid_client_cert = "${pulp_pki_dir}/qpid/client.crt"
$qpid_client_ca_cert = "${pulp_pki_dir}/qpid/ca.crt"

$qpid_router_server_cert = "${pki_dir}/qpid_router_server.crt"
$qpid_router_client_cert = "${pki_dir}/qpid_router_client.crt"
Expand Down
30 changes: 24 additions & 6 deletions manifests/qpid_client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,

$messaging_client_cert = $certs::messaging_client_cert,
$qpid_client_cert = $certs::qpid_client_cert,
$qpid_client_ca_cert = $certs::qpid_client_ca_cert,

$country = $certs::country,
$state = $certs::state,
Expand All @@ -15,6 +16,8 @@
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,

$cert_group = 'apache',
) inherits certs {

$qpid_client_cert_name = "${hostname}-qpid-client-cert"
Expand All @@ -39,16 +42,31 @@

if $deploy {

file { $certs::pulp_pki_dir:
ensure => directory,
owner => 'root',
group => $cert_group,
mode => '0640',
}

file { "${certs::pulp_pki_dir}/qpid":
ensure => directory,
owner => 'root',
group => $cert_group,
mode => '0640',
} ~>
Cert[$qpid_client_cert_name] ~>
key_bundle { $messaging_client_cert:
key_bundle { $qpid_client_cert:
key_pair => Cert[$qpid_client_cert_name],
} ~>
file { $messaging_client_cert:
owner => 'apache',
group => 'apache',
file { $qpid_client_cert:
owner => 'root',
group => $cert_group,
mode => '0640',
} ~>
pubkey { $qpid_client_ca_cert:
key_pair => $default_ca,
}

}

}
4 changes: 2 additions & 2 deletions spec/classes/certs_qpid_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
end

it do
is_expected.to contain_key_bundle('/etc/pki/katello/qpid_client_striped.crt')
is_expected.to contain_key_bundle('/etc/pki/pulp/qpid/client.crt')
.with_key_pair('Cert[foo.example.com-qpid-client-cert]')
end

it { is_expected.to contain_file('/etc/pki/katello/qpid_client_striped.crt') }
it { is_expected.to contain_file('/etc/pki/pulp/qpid/client.crt') }
end
end
end
Expand Down

0 comments on commit 7d07cac

Please sign in to comment.