Skip to content

Commit 2ee2264

Browse files
committed
install_test_cluster: Download custom PE archive before calling peadm
1 parent b0822dd commit 2ee2264

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

spec/acceptance/peadm_spec/plans/install_test_cluster.pp

+20-5
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@
3939
download_mode => $download_mode,
4040
code_manager_auto_configure => $code_manager_auto_configure,
4141
version => $version,
42-
pe_installer_source => $pe_installer_source,
4342
permit_unsafe_versions => $permit_unsafe_versions,
4443
}
4544

46-
$arch_params =
47-
case $architecture {
45+
$arch_params = case $architecture {
4846
'standard': {{
4947
primary_host => $t.filter |$n| { $n.vars['role'] == 'primary' },
5048
} }
@@ -76,8 +74,25 @@
7674
default: { fail('Invalid architecture!') }
7775
}
7876

79-
$install_result =
80-
run_plan('peadm::install', $arch_params + $common_params)
77+
if $pe_installer_source {
78+
$platform = run_task('peadm::precheck', $arch_params['primary_host']).first['platform']
79+
$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
80+
$upload_tarball_path = "/tmp/${pe_tarball_name}"
81+
82+
if $download_mode == 'bolthost' {
83+
run_plan('peadm::util::retrieve_and_upload', $arch_params['primary_host'],
84+
source => $pe_installer_source,
85+
local_path => "/tmp/${pe_tarball_name}",
86+
upload_path => $upload_tarball_path,
87+
)
88+
} else {
89+
run_task('peadm::download', $arch_params['primary_host'],
90+
source => $pe_installer_source,
91+
path => $upload_tarball_path,
92+
)
93+
}
94+
}
95+
$install_result = run_plan('peadm::install', $arch_params + $common_params)
8196

8297
return($install_result)
8398
}

0 commit comments

Comments
 (0)