Project

General

Profile

Actions

Bug #2839

closed

Openstack finish script fails to authenticate

Added by Ian Mordey over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Compute resources
Target version:
Difficulty:
easy
Triaged:
Fixed in Releases:
Found in Releases:

Description

Foreman 1.2.0 fails to authenticate via ssh for finish script and rolls back. I've tested this creating a Fedora 19 Host on Openstack Grizzly (from RDO). From the Fedora host logs I can see Foreman attempts to authenticate before the fedora user is actually created.

Reproduction:
1. Create new Fedora 19 Host through Foreman
2. Foreman provisions the host on Openstack
3. Foreman fails to authenticate
4. Foreman rolls back

Fix:
Add this to ssh.rb:
  • ssh.rb.old 2013-07-25 17:59:29.389244296 +0100
    --- ssh.rb 2013-07-25 18:00:23.041063187 +0100 *******
  • 89,98 **
    --- 89,102 ----
    retry
    rescue Net::SSH::ConnectionTimeout
    logger.debug "Host timed out for #{address}, retrying"
    sleep(2)
    retry
    + rescue Net::SSH::AuthenticationFailed
    + logger.debug "Auth failed.. retrying"
    + sleep(2)
    + retry
    rescue Timeout::Error
    retry
    rescue => e
    logger.debug "SSH error: #{e.message}\n " + e.backtrace.join("\n ")
    end

I'm not sure this is a good fix but it works for me..

Actions

Also available in: Atom PDF