conjure 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### Version 0.2.1
2
+ 2014-3-19
3
+
4
+ * Uniquify server name to avoid conflicts when provisioning
5
+ * Remove existing fog_default key to avoid conflicts when provisioning
6
+
1
7
  ### Version 0.2.0
2
8
  2014-3-18
3
9
 
@@ -35,7 +35,8 @@ module Conjure
35
35
  def self.create(name)
36
36
  puts "Creating DigitalOcean droplet..."
37
37
  connection = Fog::Compute.new compute_options
38
- new connection.servers.bootstrap(bootstrap_options name)
38
+ delete_default_key connection
39
+ new connection.servers.bootstrap(bootstrap_options uniquify(name))
39
40
  end
40
41
 
41
42
  def self.compute_options
@@ -59,6 +60,15 @@ module Conjure
59
60
  :public_key_path => "#{ssh_dir}/id_rsa.pub",
60
61
  }
61
62
  end
63
+
64
+ def self.delete_default_key(connection)
65
+ connection.ssh_keys.find{|k| k.name=="fog_default"}.try :destroy
66
+ end
67
+
68
+ def self.uniquify(server_name)
69
+ require "securerandom"
70
+ "#{server_name}-#{SecureRandom.hex 4}"
71
+ end
62
72
  end
63
73
  end
64
74
  end
@@ -1,3 +1,3 @@
1
1
  module Conjure
2
- VERSION = "0.2.0" unless defined?(VERSION)
2
+ VERSION = "0.2.1" unless defined?(VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: