Skip to content

Commit

Permalink
Merge pull request #19894 from pdostal/wait_for_ssh_password_glitch
Browse files Browse the repository at this point in the history
Add PasswordAuthentication=no to first ssh command in publiccloud::instance::wait_for_ssh
  • Loading branch information
asmorodskyi authored Aug 7, 2024
2 parents 229245c + d2e8371 commit a08438d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions data/publiccloud/ssh_config
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ StrictHostKeyChecking no
HostKeyAlgorithms +ssh-rsa
IdentityFile %SSH_KEY%
ControlPersist 86400
PasswordAuthentication no

3 changes: 2 additions & 1 deletion lib/publiccloud/instance.pm
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ sub wait_for_ssh {
script_run("ssh-keyscan $args{public_ip} | tee -a ~/.ssh/known_hosts");
while (($duration = time() - $start_time) < $args{timeout}) {
# timeout recalculated removing consumed time until now
$sysout = $self->ssh_script_output(cmd => 'sudo systemctl is-system-running',
# We don't support password authentication so it would just block the terminal
$sysout = $self->ssh_script_output(cmd => 'sudo systemctl is-system-running', ssh_opts => '-o PasswordAuthentication=no',
timeout => $args{timeout} - $duration, proceed_on_failure => 1, username => $args{username});
# result check
if ($sysout =~ m/initializing|starting/) { # still starting
Expand Down

0 comments on commit a08438d

Please sign in to comment.