From e5a6678d4e4bc99e9f17d0dbea9c44416b78a982 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Mon, 4 Nov 2024 16:47:06 +0100 Subject: [PATCH] upgrade_test_cluster: Download custom PE archive before calling peadm --- .../peadm_spec/plans/upgrade_test_cluster.pp | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/spec/acceptance/peadm_spec/plans/upgrade_test_cluster.pp b/spec/acceptance/peadm_spec/plans/upgrade_test_cluster.pp index a501d782..293093b5 100644 --- a/spec/acceptance/peadm_spec/plans/upgrade_test_cluster.pp +++ b/spec/acceptance/peadm_spec/plans/upgrade_test_cluster.pp @@ -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' }, } } @@ -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) }