conjure 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +6 -0
- data/lib/conjure/provision/server.rb +11 -1
- data/lib/conjure/version.rb +1 -1
- metadata +1 -1
data/History.md
CHANGED
@@ -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
|
-
|
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
|
data/lib/conjure/version.rb
CHANGED