|
8 | 8 | Stdlib::Absolutepath $ca_cert = $certs::candlepin_ca_cert, |
9 | 9 | Stdlib::Absolutepath $ca_key = $certs::candlepin_ca_key, |
10 | 10 | Stdlib::Absolutepath $pki_dir = $certs::pki_dir, |
| 11 | + Optional[String] $keystore_password = undef, |
11 | 12 | Stdlib::Absolutepath $keystore = $certs::candlepin_keystore, |
12 | 13 | String $keystore_password_file = 'keystore_password-file', |
| 14 | + Optional[String] $truststore_password = undef, |
13 | 15 | Stdlib::Absolutepath $truststore = $certs::candlepin_truststore, |
14 | 16 | String $truststore_password_file = 'truststore_password-file', |
15 | 17 | String[2,2] $country = $certs::country, |
|
68 | 70 | build_dir => $certs::ssl_build_dir, |
69 | 71 | } |
70 | 72 |
|
71 | | - $keystore_password = extlib::cache_data('foreman_cache_data', $keystore_password_file, extlib::random_password(32)) |
72 | | - $truststore_password = extlib::cache_data('foreman_cache_data', $truststore_password_file, extlib::random_password(32)) |
| 73 | + # Generate and cache the password on the master once |
| 74 | + # In multi-puppetmaster setups, the user should specify their own |
| 75 | + $final_keystore_password = pick_default( |
| 76 | + $keystore_password, extlib::cache_data('foreman_cache_data', $keystore_password_file, extlib::random_password(32)) |
| 77 | + ) |
| 78 | + $final_truststore_password = pick_default( |
| 79 | + $truststore_password, extlib::cache_data('foreman_cache_data', $truststore_password_file, extlib::random_password(32)) |
| 80 | + ) |
73 | 81 | $keystore_password_path = "${pki_dir}/${keystore_password_file}" |
74 | 82 | $truststore_password_path = "${pki_dir}/${truststore_password_file}" |
75 | 83 | $client_key = $certs::foreman::client_key |
|
110 | 118 |
|
111 | 119 | file { $keystore_password_path: |
112 | 120 | ensure => file, |
113 | | - content => $keystore_password, |
| 121 | + content => $final_keystore_password, |
114 | 122 | owner => 'root', |
115 | 123 | group => $group, |
116 | 124 | mode => '0440', |
|
135 | 143 |
|
136 | 144 | file { $truststore_password_path: |
137 | 145 | ensure => file, |
138 | | - content => $truststore_password, |
| 146 | + content => $final_truststore_password, |
139 | 147 | owner => 'root', |
140 | 148 | group => $group, |
141 | 149 | mode => '0440', |
|
0 commit comments