Skip to content

Commit 5c14917

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

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

spec/acceptance/peadm_spec/plans/install_test_cluster.pp

+22-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,27 @@
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+
$targets = $arch_params.values.flatten
79+
$platform = run_task('peadm::precheck', $arch_params['primary_host']).first['platform']
80+
$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
81+
$upload_tarball_path = "/tmp/${pe_tarball_name}"
82+
83+
if $download_mode == 'bolthost' {
84+
run_plan('peadm::util::retrieve_and_upload', $targets,
85+
source => $pe_installer_source,
86+
local_path => "/tmp/${pe_tarball_name}",
87+
upload_path => $upload_tarball_path,
88+
)
89+
} else {
90+
run_task('peadm::download', $targets,
91+
source => $pe_installer_source,
92+
path => $upload_tarball_path,
93+
)
94+
}
95+
}
96+
97+
$install_result = run_plan('peadm::install', $arch_params + $common_params)
8198

8299
return($install_result)
83100
}

0 commit comments

Comments
 (0)