Skip to content

Commit

Permalink
Merge pull request #17744 from hashicorp/jbardin/retry-ssh-auth
Browse files Browse the repository at this point in the history
retry ssh authentication failures
  • Loading branch information
jbardin authored Mar 30, 2018
2 parents 0deb6e8 + 943972c commit d8b9337
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions communicator/ssh/communicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,12 @@ func (c *Communicator) Connect(o terraform.UIOutput) (err error) {
host := fmt.Sprintf("%s:%d", c.connInfo.Host, c.connInfo.Port)
sshConn, sshChan, req, err := ssh.NewClientConn(c.conn, host, c.config.config)
if err != nil {
log.Printf("fatal handshake error: %s", err)
return fatalError{err}
// While in theory this should be a fatal error, some hosts may start
// the ssh service before it is properly configured, or before user
// authentication data is available.
// Log the error, and allow the provisioner to retry.
log.Printf("[WARN] %s", err)
return err
}

c.client = ssh.NewClient(sshConn, sshChan, req)
Expand Down

0 comments on commit d8b9337

Please sign in to comment.