Skip to content

Commit

Permalink
upgrade_test_cluster: Download custom PE archive before calling peadm
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Nov 4, 2024
1 parent 5c14917 commit e5a6678
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions spec/acceptance/peadm_spec/plans/upgrade_test_cluster.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@
$common_params = {
download_mode => $download_mode,
version => $version,
pe_installer_source => $pe_installer_source,
permit_unsafe_versions => $permit_unsafe_versions,
}

$arch_params =
case $architecture {
$arch_params = case $architecture {
'standard': {{
primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
} }
Expand Down Expand Up @@ -53,6 +51,26 @@
default: { fail('Invalid architecture!') }
}

if $pe_installer_source {
$targets = $arch_params.values.flatten
$platform = run_task('peadm::precheck', $arch_params['primary_host']).first['platform']
$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
$upload_tarball_path = "/tmp/${pe_tarball_name}"

if $download_mode == 'bolthost' {
run_plan('peadm::util::retrieve_and_upload', $targets,
source => $pe_installer_source,
local_path => "/tmp/${pe_tarball_name}",
upload_path => $upload_tarball_path,
)
} else {
run_task('peadm::download', $targets,
source => $pe_installer_source,
path => $upload_tarball_path,
)
}
}

$params = $arch_params + $common_params
run_plan('peadm::upgrade', $params)
}

0 comments on commit e5a6678

Please sign in to comment.