lib/gogetit/util.rb in gogetit-0.2.0 vs lib/gogetit/util.rb in gogetit-0.2.1

- old
+ new

@@ -88,9 +88,23 @@ else thing end end + def wait_until_available(fqdn, logger) + until ping_available?(fqdn) + logger.info("Calling <#{__method__.to_s}> for ping to be ready..") + sleep 3 + end + logger.info("#{fqdn} is now available to ping..") + + until ssh_available?(fqdn, 'ubuntu') + logger.info("Calling <#{__method__.to_s}> for ssh to be ready..") + sleep 3 + end + logger.info("#{fqdn} is now available to ssh..") + end + def ping_available?(fqdn) `ping -c 1 -W 1 #{fqdn}` $?.exitstatus == 0 end