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.
- data/CHANGES.txt +4 -0
- data/bin/rudy-ec2 +5 -0
- data/lib/rudy.rb +1 -1
- data/lib/rudy/aws/ec2/image.rb +19 -6
- data/lib/rudy/cli/aws/ec2/images.rb +21 -3
- data/rudy.gemspec +1 -1
- metadata +4 -4
data/CHANGES.txt
CHANGED
|
@@ -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
|
data/bin/rudy-ec2
CHANGED
|
@@ -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
|
data/lib/rudy.rb
CHANGED
data/lib/rudy/aws/ec2/image.rb
CHANGED
|
@@ -82,12 +82,25 @@ module Rudy::AWS
|
|
|
82
82
|
true
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
-
# +
|
|
86
|
-
#
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
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
|
|
data/rudy.gemspec
CHANGED
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:
|
|
4
|
+
hash: 3
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 9
|
|
9
9
|
- 8
|
|
10
|
-
-
|
|
11
|
-
version: 0.9.8.
|
|
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-
|
|
19
|
+
date: 2010-11-29 00:00:00 -05:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|