Sha256: 8065c632a08873c9009ce56ba697c8d1e66f985c8be9287fc65057aa66c15edf

Contents?: true

Size: 901 Bytes

Versions: 29

Compression:

Stored size: 901 Bytes

Contents

# All examples presume that you have a ~/.fog credentials file set up.
# More info on it can be found here: http://fog.io/about/getting_started.html
# Code can be ran by simply invoking `ruby bootstrap.rb`
# Note: this example will require 'net-ssh' gem to be installed

require "bundler"
Bundler.require(:default, :development)

p "Connecting to google..."
p "======================="
connection = Fog::Compute.new(:provider => "Google")

p "Bootstrapping a server..."
p "========================="
server = connection.servers.bootstrap

p "Waiting for server to be sshable..."
p "==================================="
server.wait_for { sshable? }

p "Trying to send an SSH command..."
p "================================"
raise "Could not bootstrap sshable server." unless server.ssh("whoami")

p "Deleting a server..."
p "===================="
raise "Could not delete server." unless server.destroy

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
fog-google-1.24.1 examples/bootstrap.rb
fog-google-1.24.0 examples/bootstrap.rb
fog-google-1.23.0 examples/bootstrap.rb
fog-google-1.22.0 examples/bootstrap.rb
fog-google-1.21.1 examples/bootstrap.rb
fog-google-1.21.0 examples/bootstrap.rb
fog-google-1.20.0 examples/bootstrap.rb
fog-google-1.19.0 examples/bootstrap.rb
fog-google-1.18.0 examples/bootstrap.rb
fog-google-1.17.0 examples/bootstrap.rb
fog-google-1.16.1 examples/bootstrap.rb
fog-google-1.16.0 examples/bootstrap.rb
fog-google-1.15.0 examples/bootstrap.rb
fog-google-1.14.0 examples/bootstrap.rb
gitlab-fog-google-1.14.0 examples/bootstrap.rb
fog-google-1.13.0 examples/bootstrap.rb
gitlab-fog-google-1.13.0 examples/bootstrap.rb
fog-google-1.12.1 examples/bootstrap.rb
fog-google-1.12.0 examples/bootstrap.rb
fog-google-1.11.0 examples/bootstrap.rb