lib/rubber/cloud/digital_ocean.rb in rubber-2.14.0 vs lib/rubber/cloud/digital_ocean.rb in rubber-2.15.0

- old
+ new

@@ -27,15 +27,15 @@ env['compute_credentials'] = compute_credentials super(env, capistrano) end - # As of July 2014 Digital Ocean supports private networking in - # New York 2 (id 4), Amsterdam 2 (id 5), Singapore 1 (id 6) and London 1 (id 7) - REGIONS_WITH_PRIVATE_NETWORKING = [4, 5, 6, 7] + # As of October 2014 Digital Ocean supports private networking in + # New York 2 (id 4), New York 3 (id 8), Amsterdam 2 (id 5), Amsterdam 3 (id 9), Singapore 1 (id 6) and London 1 (id 7) + REGIONS_WITH_PRIVATE_NETWORKING = [4, 5, 6, 7, 8, 9] - def create_instance(instance_alias, image_name, image_type, security_groups, availability_zone, region) + def create_instance(instance_alias, image_name, image_type, security_groups, availability_zone, region, fog_options={}) do_region = compute_provider.regions.find { |r| r.name == region } if do_region.nil? raise "Invalid region for DigitalOcean: #{region}" end @@ -62,15 +62,17 @@ else raise 'Missing key_file for DigitalOcean' end end - response = compute_provider.servers.create(:name => "#{Rubber.env}-#{instance_alias}", + response = compute_provider.servers.create({:name => "#{Rubber.env}-#{instance_alias}", :image_id => image.id, :flavor_id => flavor.id, :region_id => do_region.id, :ssh_key_ids => [ssh_key['id']], - :private_networking => (env.private_networking.to_s.downcase == 'true')) + :private_networking => (env.private_networking.to_s.downcase == 'true')}. + merge(Rubber::Util.symbolize_keys(fog_options)) + ) response.id end def describe_instances(instance_id=nil)