Skip to content

Commit 4ba477a

Browse files
ehelmsekohl
authored andcommitted
Deploy the CA password file to ssl build directory
As the pki_dir is intended for deployment rather than generation, and the CA password file is needed primarily for certificate generation it should reside in the build directory.
1 parent dd726d7 commit 4ba477a

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

manifests/ca.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
String $ca_key_password = $certs::ca_key_password,
2424
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
2525
) {
26+
file { "${certs::pki_dir}/private/${default_ca_name}.pwd":
27+
ensure => absent,
28+
}
29+
2630
file { $ca_key_password_file:
2731
ensure => file,
2832
content => $ca_key_password,

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
$ca_cert = "${pki_dir}/certs/${default_ca_name}.crt"
105105
$ca_cert_stripped = "${pki_dir}/certs/${default_ca_name}-stripped.crt"
106106
$ca_key_password = extlib::cache_data('foreman_cache_data', 'ca_key_password', extlib::random_password(24))
107-
$ca_key_password_file = "${pki_dir}/private/${default_ca_name}.pwd"
107+
$ca_key_password_file = "${ssl_build_dir}/${default_ca_name}.pwd"
108108

109109
$katello_server_ca_cert = "${pki_dir}/certs/${server_ca_name}.crt"
110110
$katello_default_ca_cert = "${pki_dir}/certs/${default_ca_name}.crt"

spec/acceptance/certs_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@
6565
describe package("katello-server-ca") do
6666
it { should_not be_installed }
6767
end
68+
69+
describe file('/root/ssl-build/katello-default-ca.pwd') do
70+
it { should exist }
71+
end
72+
73+
describe file('/etc/pki/katello/private/katello-default-ca.pwd') do
74+
it { should_not exist }
75+
end
6876
end
6977

7078
context 'with deploy false' do

0 commit comments

Comments
 (0)