rudy 0.9.8.017 → 0.9.8.018

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.
@@ -1,6 +1,10 @@
1
1
  RUDY, CHANGES
2
2
 
3
3
 
4
+ #### 0.9.8.018 (2010-11-27) #######################
5
+
6
+ * ADDED: Support for registering EBS-based images. (See rudy-ec2 images -h)
7
+
4
8
  #### 0.9.8.017 (2010-11-11) #######################
5
9
 
6
10
  * FIXED: adduser handler checks for root before using sudo
@@ -108,6 +108,11 @@ module RudyCLI_EC2
108
108
  option :o, :owner, String, "Amazon Account Number or one of: amazon, self"
109
109
  option :l, :all, "Display all registered machine images (warning: slow)"
110
110
  #option :p, :private, "Private images only"
111
+ option :r, :ramdisk, String, "Ramdisk ID (EBS only)"
112
+ option :k, :kernel, String, "Kernel ID (EBS only)"
113
+ option :s, :snapshot, String, "Snapshot ID (EBS only)"
114
+ option :a, :arch, String, "Architecture. One of: i386, x86_64 (EBS only)"
115
+ option :d, :description, String, "A description of the image (EBS only)"
111
116
  action :R, :register, "Register an image"
112
117
  action :D, :destroy, "Deregister an image (does not remove image files from S3)"
113
118
  argv :ami
@@ -44,7 +44,7 @@ module Rudy
44
44
  MAJOR = 0.freeze
45
45
  MINOR = 9.freeze
46
46
  TINY = 8.freeze
47
- PATCH = '017'.freeze
47
+ PATCH = '018'.freeze
48
48
  end
49
49
  def self.to_s; [MAJOR, MINOR, TINY, PATCH].join('.'); end
50
50
  def self.to_f; self.to_s.to_f; end
@@ -82,12 +82,25 @@ module Rudy::AWS
82
82
  true
83
83
  end
84
84
 
85
- # +path+ the S3 path to the manifest (bucket/file.manifest.xml)
86
- # Returns the AMI ID when successful, otherwise throws an exception.
87
- def register(path)
88
- opts = {
89
- :image_location => path
90
- }
85
+ # +opts+ can be the S3 path to the manifest (bucket/file.manifest.xml)
86
+ # or a hash containing the following options:
87
+ #
88
+ # [optional, String] :image_location ("") S3 URL for the XML manifest
89
+ # [optional, String] :name ("") Name of EBS image
90
+ # [optional, String] :description ("") Description of EBS image
91
+ # [optional, String] :architecture ("") Architecture of EBS image, currently 'i386' or 'x86_64'
92
+ # [optional, String] :kernel_id ("") Kernel ID of EBS image
93
+ # [optional, String] :ramdisk_id ("") Ramdisk ID of EBS image
94
+ # [optional, String] :root_device_name ("") Root device name of EBS image, eg '/dev/sda1'
95
+ # [optional, Array] :block_device_mapping ([]) An array of Hashes representing the elements of the block device mapping. e.g. [{:device_name => '/dev/sdh', :virtual_name => '', :ebs_snapshot_id => '', :ebs_volume_size => '', :ebs_delete_on_termination => ''},{},...]
96
+ # i.e.
97
+ # :block_device_mapping => [{
98
+ # :device_name => "/dev/sda1",
99
+ # :ebs_snapshot_id => "snap-01234567",
100
+ # :ebs_delete_on_termination => true,
101
+ # }]
102
+ def register(opts)
103
+ opts = Hash === opts ? opts : { :image_location => opts }
91
104
  ret = @@ec2.register_image(opts)
92
105
  return nil unless ret && ret.is_a?(Hash)
93
106
  ret['imageId']
@@ -14,12 +14,10 @@ module AWS; module EC2;
14
14
  true
15
15
  end
16
16
  def images
17
-
18
17
  unless @option.all
19
18
  @option.owner ||= 'amazon'
20
19
  li "Images owned by #{@option.owner.bright}" unless @argv.awsid
21
20
  end
22
-
23
21
  images = Rudy::AWS::EC2::Images.list(@option.owner, @argv) || []
24
22
  print_stobjects images
25
23
  end
@@ -41,7 +39,27 @@ module AWS; module EC2;
41
39
  true
42
40
  end
43
41
  def register_images
44
- li Rudy::AWS::EC2::Images.register(@argv.first)
42
+ if @option.snapshot
43
+ opts = {
44
+ :name => @argv.first,
45
+ :architecture => @option.arch || 'i386',
46
+ :description => @option.description || 'Made with Rudy',
47
+ :root_device_name => "/dev/sda1",
48
+ :block_device_mapping => [{
49
+ :device_name => "/dev/sda1",
50
+ :ebs_snapshot_id => @option.snapshot,
51
+ :ebs_delete_on_termination => true
52
+ }]
53
+ }
54
+ opts[:kernel_id] = @option.kernel if @option.kernel
55
+ opts[:ramdisk_id] = @option.ramdisk if @option.ramdisk
56
+ else
57
+ opts = {
58
+ :image_location => @argv.first
59
+ }
60
+ end
61
+ p opts if Rudy.debug?
62
+ li Rudy::AWS::EC2::Images.register(opts)
45
63
  end
46
64
 
47
65
 
@@ -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.9.8.017"
4
+ s.version = "0.9.8.018"
5
5
  s.summary = "Rudy: Not your grandparents' EC2 deployment tool."
6
6
  s.description = s.summary
7
7
  s.author = "Delano Mandelbaum"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rudy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 8
10
- - 17
11
- version: 0.9.8.017
10
+ - 18
11
+ version: 0.9.8.018
12
12
  platform: ruby
13
13
  authors:
14
14
  - Delano Mandelbaum
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-11 00:00:00 -05:00
19
+ date: 2010-11-29 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency