|
16 | 16 | $common_params = {
|
17 | 17 | download_mode => $download_mode,
|
18 | 18 | version => $version,
|
19 |
| - pe_installer_source => $pe_installer_source, |
20 | 19 | permit_unsafe_versions => $permit_unsafe_versions,
|
21 | 20 | }
|
22 | 21 |
|
23 |
| - $arch_params = |
24 |
| - case $architecture { |
| 22 | + $arch_params = case $architecture { |
25 | 23 | 'standard': {{
|
26 | 24 | primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
|
27 | 25 | } }
|
|
53 | 51 | default: { fail('Invalid architecture!') }
|
54 | 52 | }
|
55 | 53 |
|
| 54 | + if $pe_installer_source { |
| 55 | + $platform = run_task('peadm::precheck', $arch_params['primary_host']).first['platform'] |
| 56 | + $pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz" |
| 57 | + $upload_tarball_path = "/tmp/${pe_tarball_name}" |
| 58 | + |
| 59 | + if $download_mode == 'bolthost' { |
| 60 | + run_plan('peadm::util::retrieve_and_upload', $arch_params['primary_host'], |
| 61 | + source => $pe_installer_source, |
| 62 | + local_path => "/tmp/${pe_tarball_name}", |
| 63 | + upload_path => $upload_tarball_path, |
| 64 | + ) |
| 65 | + } else { |
| 66 | + run_task('peadm::download', $arch_params['primary_host'], |
| 67 | + source => $pe_installer_source, |
| 68 | + path => $upload_tarball_path, |
| 69 | + ) |
| 70 | + } |
| 71 | + } |
| 72 | + |
56 | 73 | $params = $arch_params + $common_params
|
57 | 74 | run_plan('peadm::upgrade', $params)
|
58 | 75 | }
|
0 commit comments