Skip to content

Commit 4cdc8b2

Browse files
committed
(PE-39224) Adding random console password for forked pr workflow
CI jobs triggered from forked branches aren't able to access secrets. In this case we are using a randomised password.
1 parent a224836 commit 4cdc8b2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

spec/acceptance/peadm_spec/plans/install_test_cluster.pp

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
Optional[String[1]] $pe_installer_source = undef,
77
Boolean $permit_unsafe_versions = false,
88
Enum['enable', 'disable'] $fips = 'disable',
9-
String[1] $console_password
10-
9+
String $console_password
1110
) {
1211
$t = get_targets('*')
1312
wait_until_available($t)
@@ -26,8 +25,17 @@
2625
}
2726
}
2827

28+
# CI jobs triggered from forks don't have access to secrets, so use randomized input instead
29+
if $console_password == '' {
30+
$cp = run_command(
31+
'LC_ALL=C tr -dc \'A-Za-z0-9!"#$%&\'\\\'\'()*+,-./:;<=>?@[\]^_`{|}~\' </dev/urandom | head -c 30; echo', localhost
32+
).first['stdout'].chomp
33+
} else {
34+
$cp = $console_password
35+
}
36+
2937
$common_params = {
30-
console_password => $console_password,
38+
console_password => $cp,
3139
download_mode => $download_mode,
3240
code_manager_auto_configure => $code_manager_auto_configure,
3341
version => $version,

0 commit comments

Comments
 (0)