solutious-rudy 0.7.4 → 0.7.5

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/CHANGES.txt CHANGED
@@ -5,7 +5,12 @@ RUDY, CHANGES
5
5
  * TODO: Tests for zone and region support
6
6
  * TODO: Support for machine image attributes
7
7
  * TODO: Support for product codes
8
- * TODO: Tests for AWS HTTPS
8
+
9
+ #### 0.7.5 (2009-05-??) ###############################
10
+
11
+ * CHANGE: rudy-ec2 console now displays windows password automatically if keypair is supplied.
12
+ * ADDED: register and destroy commands to rudy-ec2 images
13
+
9
14
 
10
15
  #### 0.7.4 (2009-05-10) ###############################
11
16
 
data/README.rdoc CHANGED
@@ -105,6 +105,14 @@ I'm very open to contributions!
105
105
  * Rudy::AWS::SDB adapted from aws_sdb by Tim Dysinger (http://dysinger.net)
106
106
 
107
107
 
108
+ == Related Projects
109
+
110
+ * Pool Party -- http://www.poolpartyrb.com/
111
+ * Rubber -- http://github.com/wr0ngway/rubber/wikis
112
+ * Moonshine -- http://github.com/railsmachine/moonshine/tree
113
+ * Boto -- http://code.google.com/p/boto/
114
+
115
+
108
116
  == License
109
117
 
110
118
  See: LICENSE.txt
data/Rudyfile CHANGED
@@ -169,13 +169,13 @@ routines do
169
169
 
170
170
  anything do # $ rudy anything
171
171
  before :display_uptime # Specify a dependency
172
- script Rudy.sysinfo.user do # This is Ruby, so any valid syntax
173
- ls :l, Rudy.sysinfo.home # can be used in the definitions.
172
+ script :rudy do # This is Ruby, so any valid syntax
173
+ ls :l # can be used in the definitions.
174
174
  end # See: SysInfo gem for more info.
175
175
  end
176
176
 
177
177
  display_uptime do # $ rudy display-uptime
178
- script Rudy.sysinfo.user do # NOTE: You can use 'dashes' on the
178
+ script :rudy do # NOTE: You can use 'dashes' on the
179
179
  uptime # command-line instead of underscores
180
180
  end
181
181
  end
data/bin/rudy CHANGED
@@ -10,7 +10,7 @@
10
10
 
11
11
  $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') # Put our local lib in first place
12
12
  $:.unshift File.join(File.dirname(__FILE__), '..', '..', 'drydock', 'lib')
13
- #require 'rubygems'
13
+ require 'rubygems'
14
14
 
15
15
  #$SAFE = 1 # require is unsafe in Ruby 1.9??
16
16
 
@@ -21,7 +21,7 @@ require 'rudy/cli'
21
21
  # Command-line interface for /bin/rudy
22
22
  class RudyCLI < Rudy::CLI::Base
23
23
 
24
- debug :off
24
+ debug :on
25
25
  default :machines
26
26
  trawler :passthrough
27
27
 
data/bin/rudy-ec2 CHANGED
@@ -102,6 +102,7 @@ module RudyCLI_EC2
102
102
  usage "rudy-ec2 images -o 123456789012"
103
103
  usage "rudy-ec2 images -o amazon"
104
104
  usage "rudy-ec2 images -o self"
105
+ usage "rudy-ec2 images -R bucket/ami-name.manifest.xml"
105
106
  option :o, :owner, String, "Amazon Account Number or one of: amazon, self"
106
107
  option :l, :all, "Display all registered machine images (warning: slow)"
107
108
  #option :p, :private, "Private images only"
@@ -110,6 +111,7 @@ module RudyCLI_EC2
110
111
  option :u, :user, String, "Username to connect as (used for creating an image)"
111
112
  action :C, :create, "Create an image"
112
113
  #action :P, :prepare, "Prepare a running instance to be used as an image"
114
+ action :R, :register, "Register an image"
113
115
  action :D, :destroy, "Deregister an image (does not remove image files from S3)"
114
116
  argv :ami
115
117
  command :images => Rudy::CLI::AWS::EC2::Images
data/lib/rudy.rb CHANGED
@@ -4,8 +4,8 @@ unless defined?(RUDY_HOME)
4
4
  RUDY_LIB = File.join(File.dirname(__FILE__), '..', 'lib')
5
5
  end
6
6
 
7
- #local_libs = %w{net-scp amazon-ec2 aws-s3 caesars drydock rye storable sysinfo annoy}
8
- #local_libs.each { |dir| $:.unshift File.join(RUDY_HOME, '..', dir, 'lib') }
7
+ local_libs = %w{net-scp amazon-ec2 aws-s3 caesars drydock rye storable sysinfo annoy}
8
+ local_libs.each { |dir| $:.unshift File.join(RUDY_HOME, '..', dir, 'lib') }
9
9
 
10
10
  require 'digest/md5'
11
11
  require 'stringio'
@@ -106,7 +106,7 @@ module Rudy::AWS
106
106
  :image_id => id
107
107
  }
108
108
  ret = @ec2.deregister_image(opts)
109
- puts ret.to_yaml
109
+ return false unless ret && ret.is_a?(Hash)
110
110
  true
111
111
  end
112
112
 
@@ -117,8 +117,8 @@ module Rudy::AWS
117
117
  :image_location => path
118
118
  }
119
119
  ret = @ec2.register_image(opts)
120
- puts ret.to_yaml
121
- true
120
+ return nil unless ret && ret.is_a?(Hash)
121
+ ret['imageId']
122
122
  end
123
123
 
124
124
  # imageOwnerId: "203338247012"
@@ -155,24 +155,24 @@ module AWS; module EC2;
155
155
 
156
156
  end
157
157
 
158
- def deregister_valid?
158
+ def destroy_images_valid?
159
159
  unless @argv.ami && Rudy::Utils.is_id?(:image, @argv.ami)
160
- raise "You must supply an AMI ID (ami-XXXXXXX)"
160
+ raise "Must supply an AMI ID (ami-XXXXXXX)"
161
161
  end
162
+ @rimages = Rudy::AWS::EC2::Images.new(@@global.accesskey, @@global.secretkey, @@global.region)
162
163
  end
163
- def deregister
164
- puts "Deregistering #{@argv.ami}"
165
-
166
- execute_check(:medium)
167
-
168
- rimages = Rudy::AWS::EC2::Images.new(@@global.accesskey, @@global.secretkey, @@global.region)
169
-
170
- if rimages.deregister(ami)
171
- puts "Done!"
172
- else
173
- puts "There was an unknown problem!"
164
+ def destroy_images
165
+ puts @rimages.deregister(@argv.ami) ? "Done" : "Unknown error"
166
+ end
167
+
168
+ def register_images_valid?
169
+ unless @argv.first
170
+ raise "Must supply a valid manifest path (bucket/ami-name.manifest.xml)"
174
171
  end
175
-
172
+ @rimages = Rudy::AWS::EC2::Images.new(@@global.accesskey, @@global.secretkey, @@global.region)
173
+ end
174
+ def register_images
175
+ puts @rimages.register(@argv.first)
176
176
  end
177
177
 
178
178
 
@@ -144,11 +144,8 @@ module AWS; module EC2;
144
144
  encrtypted_text = ($1 || '').strip
145
145
  k = Rye::Key.from_file(@@global.pkey)
146
146
  pword = k.decrypt(encrtypted_text)
147
- ret = Annoy.pose_question("Display password?\a ", /yes|y|ya|sure|you bet!/i, STDERR)
148
- if ret
149
- answer = "%s: %s" % ['password', pword]
150
- Annoy.timed_display(answer, STDERR, 10)
151
- end
147
+ answer = "%s: %s" % ['password', pword]
148
+ Annoy.timed_display(answer, STDERR, 10)
152
149
  puts
153
150
  else
154
151
  puts "Please supply a private key path to decode the administrator password"
data/lib/rudy/routines.rb CHANGED
@@ -94,13 +94,11 @@ module Rudy
94
94
  end
95
95
  }
96
96
 
97
- unless has_remote_task?(routine)
98
- puts "[no remote tasks]"
99
- return
100
- end
101
-
102
97
  # Execute the action (create, list, destroy, restart) & apply the block to each
98
+ machines = []
103
99
  rmach.send(machine_action) do |machine|
100
+ machines << machine
101
+
104
102
  puts machine_separator(machine.name, machine.awsid) unless skip_header
105
103
 
106
104
  unless skip_check
@@ -152,6 +150,10 @@ module Rudy
152
150
  }
153
151
  end
154
152
 
153
+ unless has_remote_task?(routine)
154
+ puts "[no remote tasks]"
155
+ next
156
+ end
155
157
 
156
158
  enjoy_every_sandwich {
157
159
  if Rudy::Routines::UserHelper.adduser?(routine) # adduser
@@ -10,16 +10,14 @@ module Rudy; module Routines;
10
10
  # * +each_mach+ is an optional block which is executed between
11
11
  # disk creation and the after scripts. The will receives two
12
12
  # arguments: instances of Rudy::Machine and Rye::Box.
13
+ # Returns an Array of Rudy::Machine objects
13
14
  def execute(&each_mach)
14
15
  routine_separator(:startup)
15
16
  unless @routine
16
17
  STDERR.puts "[this is a generic startup routine]"
17
18
  @routine = {}
18
19
  end
19
- machines = []
20
- generic_machine_runner(:create) do |machine,rbox|
21
- machines << machine
22
- end
20
+ machines = generic_machine_runner(:create)
23
21
  machines
24
22
  end
25
23
 
data/rudy.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = "rudy"
3
3
  s.rubyforge_project = 'rudy'
4
- s.version = "0.7.4"
4
+ s.version = "0.7.5"
5
5
  s.summary = "Rudy: Not your grandparents' EC2 deployment tool."
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
@@ -14,11 +14,11 @@
14
14
  s.require_paths = %w[lib]
15
15
  s.rubygems_version = '1.1.1'
16
16
 
17
- s.add_dependency 'drydock', '>= 0.6.2'
18
- s.add_dependency 'caesars', '>= 0.6.4'
19
- s.add_dependency 'rye', '>= 0.6.4'
17
+ s.add_dependency 'drydock', '>= 0.6.3'
18
+ s.add_dependency 'caesars', '>= 0.6.6'
19
+ s.add_dependency 'rye', '>= 0.6.5'
20
20
  s.add_dependency 'sysinfo', '>= 0.5.1'
21
- s.add_dependency 'storable', '>= 0.5.1'
21
+ s.add_dependency 'storable', '>= 0.5.2'
22
22
  s.add_dependency 'annoy', '>= 0.5.0'
23
23
 
24
24
  s.add_dependency 'grit'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solutious-rudy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.6.2
23
+ version: 0.6.3
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: caesars
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.6.4
33
+ version: 0.6.6
34
34
  version:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: rye
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.6.4
43
+ version: 0.6.5
44
44
  version:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: sysinfo
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 0.5.1
63
+ version: 0.5.2
64
64
  version:
65
65
  - !ruby/object:Gem::Dependency
66
66
  name: annoy