Sha256: ddd003dcd877beabfcd4bb9423afb23471821ae10b468255cc5f05754e3b20bc

Contents?: true

Size: 560 Bytes

Versions: 4

Compression:

Stored size: 560 Bytes

Contents

require 'net/ssh'

module AmiSpec
  class WaitForRC
    def self.wait(ip_address, user, key)
      Net::SSH.start(ip_address, user, keys: [key], paranoid: false) do |ssh|
        # Wait for SystemV to start
        # This only works for Ubuntu with upstart.
        # Detecting OS and Release will need something like this
        # https://github.com/mizzy/specinfra/blob/master/lib/specinfra/helper/detect_os/debian.rb
        ssh.exec 'while /usr/sbin/service rc status | grep -q "^rc start/running, process"; do sleep 1; done'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ami_spec-1.0.1 lib/ami_spec/wait_for_rc.rb
ami_spec-1.0.0 lib/ami_spec/wait_for_rc.rb
ami_spec-0.3.0 lib/ami_spec/wait_for_rc.rb
ami_spec-0.2.0 lib/ami_spec/wait_for_rc.rb