Skip to content

Instantly share code, notes, and snippets.

@icco
Created December 30, 2013 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icco/8178811 to your computer and use it in GitHub Desktop.
Save icco/8178811 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
require 'fog'
connection = Fog::Compute.new({ :provider => "DigitalOcean" })
p connection.servers
server = connection.servers.bootstrap({
:name => 'fuck',
:image_id => 1505447,
:size_id => 33,
:region_id => 4,
:flavor_id => 66,
:public_key_path => File.expand_path('~/.ssh/id_rsa.pub'),
:private_key_path => File.expand_path('~/.ssh/id_rsa'),
})
server.wait_for { ready? }
connection.servers.each {|s| s.destroy }
@petems
Copy link

petems commented Jan 14, 2015

@icco This saved my life, couldn't figure out how to get the bootstrap command working in fog for DigitalOcean! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment