|
115 | 115 | # the configured hostname, and that all systems return the same platform |
116 | 116 | $precheck_results.each |$result| { |
117 | 117 | if $result.target.name != $result['hostname'] { |
118 | | - fail_plan("Hostname / DNS name mismatch: target ${result.target.name} reports '${result['hostname']}'") |
| 118 | + warning(@("HEREDOC")) |
| 119 | + WARNING: Target name / hostname mismatch: target ${result.target.name} reports ${result['hostname']} |
| 120 | + Certificate name will be set to target name. Please ensure target name is correct and resolvable |
| 121 | + |-HEREDOC |
119 | 122 | } |
120 | 123 | if $result['platform'] != $platform { |
121 | 124 | fail_plan("Platform mismatch: target ${result.target.name} reports '${result['platform']}; expected ${platform}'") |
|
148 | 151 | 'puppet_enterprise::database_host' => $puppetdb_database_replica_target.peadm::target_name(), |
149 | 152 | } + $pe_conf_data) |
150 | 153 |
|
151 | | - # Upload the pe.conf files to the hosts that need them |
152 | | - peadm::file_content_upload($master_pe_conf, '/tmp/pe.conf', $master_target) |
153 | | - peadm::file_content_upload($puppetdb_database_pe_conf, '/tmp/pe.conf', $puppetdb_database_target) |
154 | | - peadm::file_content_upload($puppetdb_database_replica_pe_conf, '/tmp/pe.conf', $puppetdb_database_replica_target) |
| 154 | + # Upload the pe.conf files to the hosts that need them, and ensure correctly |
| 155 | + # configured certnames. Right now for these hosts we need to do that by |
| 156 | + # staging a puppet.conf file. |
| 157 | + ['master', 'puppetdb_database', 'puppetdb_database_replica'].each |$var| { |
| 158 | + $target = getvar("${var}_target") |
| 159 | + $pe_conf = getvar("${var}_pe_conf") |
| 160 | + |
| 161 | + peadm::file_content_upload($pe_conf, '/tmp/pe.conf', $target) |
| 162 | + run_task('peadm::mkdir_p_file', $target, |
| 163 | + path => '/etc/puppetlabs/puppet/puppet.conf', |
| 164 | + content => @("HEREDOC"), |
| 165 | + [main] |
| 166 | + certname = ${target.peadm::target_name()} |
| 167 | + | HEREDOC |
| 168 | + ) |
| 169 | + } |
155 | 170 |
|
156 | 171 | # Download the PE tarball and send it to the nodes that need it |
157 | 172 | $pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz" |
|
290 | 305 | server => $master_target.peadm::target_name(), |
291 | 306 | install_flags => [ |
292 | 307 | '--puppet-service-ensure', 'stopped', |
| 308 | + "main:certname=${master_replica_target.peadm::target_name()}", |
293 | 309 | "main:dns_alt_names=${dns_alt_names_csv}", |
294 | 310 | "extension_requests:${pp_application}=puppet/master", |
295 | 311 | "extension_requests:${pp_cluster}=B", |
296 | 312 | ], |
297 | 313 | ) |
298 | 314 |
|
299 | | - run_task('peadm::agent_install', $compiler_a_targets, |
300 | | - server => $master_target.peadm::target_name(), |
301 | | - install_flags => [ |
302 | | - '--puppet-service-ensure', 'stopped', |
303 | | - "main:dns_alt_names=${dns_alt_names_csv}", |
304 | | - "extension_requests:${pp_application}=puppet/compiler", |
305 | | - "extension_requests:${pp_cluster}=A", |
306 | | - ], |
307 | | - ) |
308 | | - |
309 | | - run_task('peadm::agent_install', $compiler_b_targets, |
310 | | - server => $master_target.peadm::target_name(), |
311 | | - install_flags => [ |
312 | | - '--puppet-service-ensure', 'stopped', |
313 | | - "main:dns_alt_names=${dns_alt_names_csv}", |
314 | | - "extension_requests:${pp_application}=puppet/compiler", |
315 | | - "extension_requests:${pp_cluster}=B", |
316 | | - ], |
317 | | - ) |
| 315 | + ['A', 'B'].each |$group| { |
| 316 | + getvar("compiler_${group.downcase()}_targets").each |$target| { |
| 317 | + run_task('peadm::agent_install', $target, |
| 318 | + server => $master_target.peadm::target_name(), |
| 319 | + install_flags => [ |
| 320 | + '--puppet-service-ensure', 'stopped', |
| 321 | + "main:certname=${target.peadm::target_name()}", |
| 322 | + "main:dns_alt_names=${dns_alt_names_csv}", |
| 323 | + "extension_requests:${pp_application}=puppet/compiler", |
| 324 | + "extension_requests:${pp_cluster}=${group}", |
| 325 | + ], |
| 326 | + ) |
| 327 | + } |
| 328 | + } |
318 | 329 |
|
319 | 330 | # Ensure certificate requests have been submitted |
320 | 331 | run_task('peadm::submit_csr', $agent_installer_targets) |
|
0 commit comments