solutious-rudy 0.9.1 → 0.9.2
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 +40 -16
- data/README.rdoc +6 -6
- data/bin/rudy +66 -10
- data/bin/rudy-ec2 +3 -1
- data/examples/authorize.rb +15 -0
- data/examples/gem-test.rb +11 -5
- data/examples/solaris.rb +35 -0
- data/examples/windows.rb +101 -0
- data/lib/rudy.rb +7 -1
- data/lib/rudy/aws.rb +2 -2
- data/lib/rudy/aws/ec2.rb +29 -22
- data/lib/rudy/aws/ec2/group.rb +1 -1
- data/lib/rudy/aws/ec2/image.rb +1 -29
- data/lib/rudy/aws/ec2/instance.rb +4 -32
- data/lib/rudy/aws/ec2/keypair.rb +1 -6
- data/lib/rudy/aws/ec2/snapshot.rb +2 -20
- data/lib/rudy/aws/ec2/volume.rb +11 -19
- data/lib/rudy/aws/ec2/zone.rb +1 -6
- data/lib/rudy/aws/sdb.rb +1 -1
- data/lib/rudy/cli/aws/ec2/addresses.rb +4 -10
- data/lib/rudy/cli/aws/ec2/groups.rb +0 -1
- data/lib/rudy/cli/aws/ec2/images.rb +1 -4
- data/lib/rudy/cli/aws/ec2/info.rb +63 -0
- data/lib/rudy/cli/aws/ec2/instances.rb +3 -5
- data/lib/rudy/cli/aws/ec2/keypairs.rb +3 -5
- data/lib/rudy/cli/aws/ec2/snapshots.rb +2 -6
- data/lib/rudy/cli/aws/ec2/zones.rb +2 -4
- data/lib/rudy/cli/backups.rb +20 -9
- data/lib/rudy/cli/base.rb +60 -3
- data/lib/rudy/cli/candy.rb +1 -1
- data/lib/rudy/cli/disks.rb +65 -7
- data/lib/rudy/cli/execbase.rb +0 -2
- data/lib/rudy/cli/images.rb +97 -0
- data/lib/rudy/cli/info.rb +48 -0
- data/lib/rudy/cli/keypairs.rb +43 -0
- data/lib/rudy/cli/machines.rb +48 -38
- data/lib/rudy/cli/networks.rb +68 -0
- data/lib/rudy/cli/routines.rb +3 -10
- data/lib/rudy/config/objects.rb +0 -1
- data/lib/rudy/disks.rb +4 -0
- data/lib/rudy/global.rb +1 -1
- data/lib/rudy/huxtable.rb +9 -3
- data/lib/rudy/machines.rb +1 -1
- data/lib/rudy/metadata.rb +4 -1
- data/lib/rudy/metadata/backup.rb +2 -2
- data/lib/rudy/metadata/disk.rb +7 -4
- data/lib/rudy/metadata/machine.rb +66 -2
- data/lib/rudy/routines.rb +2 -1
- data/lib/rudy/routines/base.rb +4 -157
- data/lib/rudy/routines/handlers/base.rb +6 -3
- data/lib/rudy/routines/handlers/disks.rb +127 -42
- data/lib/rudy/routines/handlers/group.rb +45 -10
- data/lib/rudy/routines/handlers/host.rb +16 -10
- data/lib/rudy/routines/handlers/keypair.rb +26 -10
- data/lib/rudy/routines/handlers/rye.rb +173 -0
- data/lib/rudy/routines/handlers/script.rb +2 -1
- data/lib/rudy/routines/passthrough.rb +2 -2
- data/lib/rudy/routines/reboot.rb +2 -2
- data/lib/rudy/routines/shutdown.rb +2 -2
- data/lib/rudy/routines/startup.rb +4 -2
- data/rudy.gemspec +15 -8
- data/tryouts/10_require_time/10_rudy_tryouts.rb +1 -1
- data/tryouts/12_config/20_defaults_tryouts.rb +1 -1
- data/tryouts/12_config/40_machines_tryouts.rb +1 -1
- data/tryouts/15_huxtable/20_user_tryouts.rb +1 -1
- data/tryouts/25_ec2/10_keypairs_tryouts.rb +1 -0
- data/tryouts/30_metadata/10_include_tryouts.rb +1 -1
- data/tryouts/30_metadata/13_object_tryouts.rb +4 -0
- data/tryouts/30_metadata/50_disk_tryouts.rb +4 -2
- data/tryouts/30_metadata/51_disk_digest_tryouts.rb +1 -1
- data/tryouts/30_metadata/53_disk_list_tryouts.rb +2 -1
- data/tryouts/30_metadata/56_disk_volume_tryouts.rb +1 -1
- data/tryouts/30_metadata/60_backup_tryouts.rb +4 -2
- data/tryouts/30_metadata/63_backup_list_tryouts.rb +1 -1
- data/tryouts/30_metadata/64_backup_disk_tryouts.rb +3 -1
- data/tryouts/30_metadata/66_backup_snapshot_tryouts.rb +1 -1
- data/tryouts/30_metadata/70_machine_tryouts.rb +5 -2
- data/tryouts/30_metadata/73_machine_list_tryouts.rb +1 -1
- data/tryouts/30_metadata/76_machine_instance_tryouts.rb +15 -3
- data/tryouts/30_metadata/77_machines_tryouts.rb +1 -1
- data/tryouts/40_routines/10_keypair_handler_tryouts.rb +6 -5
- data/tryouts/40_routines/11_group_handler_tryouts.rb +1 -1
- metadata +13 -6
- data/lib/rudy/cli/status.rb +0 -60
@@ -4,13 +4,24 @@ module Rudy; module Routines; module Handlers;
|
|
4
4
|
include Rudy::Routines::Handlers::Base
|
5
5
|
extend self
|
6
6
|
|
7
|
-
|
7
|
+
Rudy::Routines.add_handler :network, self
|
8
8
|
|
9
9
|
|
10
|
-
def raise_early_exceptions(
|
10
|
+
def raise_early_exceptions(type, batch, rset, lbox, argv=nil)
|
11
11
|
|
12
12
|
end
|
13
13
|
|
14
|
+
def execute(type, routine, rset, lbox, argv=nil)
|
15
|
+
routine.each_pair do |action, definition|
|
16
|
+
unless respond_to?(action.to_sym)
|
17
|
+
Rudy::Huxtable.le %Q(GroupHandler: unknown action "#{action}")
|
18
|
+
next
|
19
|
+
end
|
20
|
+
Rudy::Huxtable.ld %Q(GroupHandler: "#{action}")
|
21
|
+
Rudy::Routines::Handlers::Group.send(action, definition)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
14
25
|
def create(name=nil)
|
15
26
|
name ||= current_group_name
|
16
27
|
return if exists? name
|
@@ -18,14 +29,12 @@ module Rudy; module Routines; module Handlers;
|
|
18
29
|
Rudy::AWS::EC2::Groups.create name
|
19
30
|
end
|
20
31
|
|
21
|
-
def authorize(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
li "Authorizing ports #{ports.inspect} access for: #{addresses.join(', ')}"
|
28
|
-
Rudy::AWS::EC2::Groups.authorize(name, addresses, ports)
|
32
|
+
def authorize(ports=nil, addresses=nil, name=nil)
|
33
|
+
modify(:authorize, ports, addresses, name)
|
34
|
+
end
|
35
|
+
|
36
|
+
def revoke(ports=nil, addresses=nil, name=nil)
|
37
|
+
modify(:revoke, ports, addresses, name)
|
29
38
|
end
|
30
39
|
|
31
40
|
def exists?(name=nil)
|
@@ -40,5 +49,31 @@ module Rudy; module Routines; module Handlers;
|
|
40
49
|
Rudy::AWS::EC2::Groups.destroy name
|
41
50
|
end
|
42
51
|
|
52
|
+
def get(name=nil)
|
53
|
+
name ||= current_group_name
|
54
|
+
Rudy::AWS::EC2::Groups.get name
|
55
|
+
end
|
56
|
+
|
57
|
+
def list
|
58
|
+
Rudy::AWS::EC2::Groups.list
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
def modify(action, ports=nil, addresses=nil, name=nil)
|
63
|
+
name ||= current_group_name
|
64
|
+
addresses ||= [Rudy::Utils::external_ip_address]
|
65
|
+
|
66
|
+
if ports.nil?
|
67
|
+
ports = current_machine_os.to_s == 'windows' ? [3389,22] : [22]
|
68
|
+
else
|
69
|
+
ports = [ports].flatten.compact
|
70
|
+
end
|
71
|
+
|
72
|
+
ports.each do |port|
|
73
|
+
#li "Authorizing port #{port} access for: #{addresses.join(', ')}"
|
74
|
+
Rudy::AWS::EC2::Groups.send(action, name, addresses, [[port, port]]) rescue nil
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
43
78
|
end
|
44
79
|
end; end; end
|
@@ -10,7 +10,9 @@ module Rudy; module Routines; module Handlers;
|
|
10
10
|
raise NoMachines if rset.boxes.empty?
|
11
11
|
rset.boxes.each do |rbox|
|
12
12
|
msg = "Waiting for #{rbox.nickname} to boot..."
|
13
|
-
|
13
|
+
multi = rbox.stash.windows? ? 6 : 3
|
14
|
+
interval, max = 1*multi, 80*multi
|
15
|
+
Rudy::Utils.waiter(interval, max, Rudy::Huxtable.logger, msg, 0) {
|
14
16
|
inst = rbox.stash.get_instance
|
15
17
|
inst && inst.running?
|
16
18
|
}
|
@@ -36,17 +38,19 @@ module Rudy; module Routines; module Handlers;
|
|
36
38
|
def is_available?(rset, port=22)
|
37
39
|
raise NoMachines if rset.boxes.empty?
|
38
40
|
rset.boxes.each do |rbox|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
msg = "Waiting for port #{port} on #{rbox.nickname} ..."
|
42
|
+
port = 3389 if rbox.stash.windows?
|
43
|
+
multi = rbox.stash.windows? ? 3 : 2
|
44
|
+
interval, max = 1*multi, 30*multi
|
45
|
+
Rudy::Utils.waiter(interval, max, STDOUT, msg, 0) {
|
46
|
+
Rudy::Utils.service_available?(rbox.stash.dns_public, port)
|
47
|
+
}
|
45
48
|
end
|
46
49
|
end
|
47
50
|
|
48
51
|
def set_hostname(rset)
|
49
52
|
raise NoMachines if rset.boxes.empty?
|
53
|
+
|
50
54
|
original_user = rset.user
|
51
55
|
rset.switch_user 'root'
|
52
56
|
rset.add_key user_keypairpath('root')
|
@@ -58,9 +62,11 @@ module Rudy; module Routines; module Handlers;
|
|
58
62
|
# run so we may want to make this an explicit action.
|
59
63
|
type = current_machine_hostname || :rudy
|
60
64
|
rset.batch(type) do |hn|
|
61
|
-
|
62
|
-
|
63
|
-
|
65
|
+
unless self.stash.os == :windows
|
66
|
+
if hn != :default
|
67
|
+
hn = self.stash.name if hn == :rudy
|
68
|
+
self.quietly { hostname(hn) }
|
69
|
+
end
|
64
70
|
end
|
65
71
|
end
|
66
72
|
rset.switch_user original_user
|
@@ -23,17 +23,33 @@ module Rudy; module Routines; module Handlers;
|
|
23
23
|
def create(name=:root)
|
24
24
|
keyname = user_keypairname name
|
25
25
|
kp_file = pkey name
|
26
|
-
|
27
|
-
if registered?
|
28
|
-
raise PrivateKeyNotFound, keyname if kp_file.nil?
|
26
|
+
|
27
|
+
if registered? name && !@@global.force
|
29
28
|
raise PrivateKeyNotFound, kp_file if !File.exists?(kp_file)
|
30
|
-
else
|
31
|
-
raise PrivateKeyFileExists, kp_file if File.exists?(kp_file)
|
32
|
-
li "Creating keypair: #{keyname}"
|
33
|
-
kp = Rudy::AWS::EC2::Keypairs.create(keyname)
|
34
|
-
li "Saving #{kp_file}"
|
35
|
-
Rudy::Utils.write_to_file(kp_file, kp.private_key, 'w', 0600)
|
36
29
|
end
|
30
|
+
|
31
|
+
if Rudy::AWS::EC2::Keypairs.exists? keyname
|
32
|
+
if @@global.force
|
33
|
+
li "Destroying existing keypair: #{keyname}"
|
34
|
+
Rudy::AWS::EC2::Keypairs.destroy keyname
|
35
|
+
else
|
36
|
+
raise Rudy::AWS::EC2::KeypairAlreadyDefined, keyname
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
if File.exists?(kp_file)
|
41
|
+
if @@global.force
|
42
|
+
delete_pkey name
|
43
|
+
else
|
44
|
+
raise PrivateKeyFileExists, kp_file
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
li "Creating keypair: #{keyname}"
|
49
|
+
kp = Rudy::AWS::EC2::Keypairs.create(keyname)
|
50
|
+
li "Saving #{kp_file}"
|
51
|
+
Rudy::Utils.write_to_file(kp_file, kp.private_key, 'w', 0600)
|
52
|
+
|
37
53
|
kp
|
38
54
|
end
|
39
55
|
|
@@ -55,7 +71,7 @@ module Rudy; module Routines; module Handlers;
|
|
55
71
|
|
56
72
|
def registered?(name=:root)
|
57
73
|
keyname = user_keypairname name
|
58
|
-
Rudy::AWS::EC2::Keypairs.exists?(
|
74
|
+
Rudy::AWS::EC2::Keypairs.exists?(keyname)
|
59
75
|
end
|
60
76
|
|
61
77
|
def pkey(name=:root)
|
@@ -0,0 +1,173 @@
|
|
1
|
+
module Rudy::Routines::Handlers;
|
2
|
+
module RyeTools
|
3
|
+
include Rudy::Routines::Handlers::Base
|
4
|
+
extend self
|
5
|
+
|
6
|
+
|
7
|
+
# Create an instance of Rye::Box for +hostname+. +opts+ is
|
8
|
+
# an optional Hash of options. See Rye::Box.initialize
|
9
|
+
#
|
10
|
+
# This method should be used throughout the Rudy::Routines
|
11
|
+
# namespace rather than creating instances manually b/c it
|
12
|
+
# applies some fancy pants defaults like command hooks.
|
13
|
+
def create_box(hostname, opts={})
|
14
|
+
ld [:hostname, hostname, opts, caller[0]]
|
15
|
+
opts = {
|
16
|
+
:info => (@@global.verbose >= 3), # rudy -vvv
|
17
|
+
:debug => false,
|
18
|
+
:user => current_machine_user,
|
19
|
+
:ostype => current_machine_os || :unix,
|
20
|
+
:impltype => :linux
|
21
|
+
}.merge opts
|
22
|
+
|
23
|
+
nickname = hostname
|
24
|
+
if hostname.kind_of? Rudy::Machine
|
25
|
+
hostname, nickname = hostname.dns_public, hostname.name
|
26
|
+
end
|
27
|
+
|
28
|
+
box = ::Rye::Box.new hostname, opts
|
29
|
+
box.nickname = nickname
|
30
|
+
|
31
|
+
local_keys = Rye.keys
|
32
|
+
box.add_keys local_keys if local_keys.is_a?(Array)
|
33
|
+
box.add_key user_keypairpath(opts[:user])
|
34
|
+
|
35
|
+
# We define hooks so we can still print each command and its output
|
36
|
+
# when running the command blocks. NOTE: We only print this in
|
37
|
+
# verbosity mode.
|
38
|
+
if @@global.verbose > 0 && !@@global.parallel
|
39
|
+
# This block gets called for every command method call.
|
40
|
+
box.pre_command_hook do |cmd, user, host, nickname|
|
41
|
+
print_command user, nickname, cmd
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
if @@global.verbose > 1
|
46
|
+
# And this one gets called after each command method call.
|
47
|
+
box.post_command_hook do |ret|
|
48
|
+
print_response ret
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
box.exception_hook(::Rye::CommandError, &rbox_exception_handler)
|
53
|
+
box.exception_hook(Exception, &rbox_exception_handler)
|
54
|
+
|
55
|
+
## It'd better for unknown commands to be handled elsewhere
|
56
|
+
## because it doesn't make sense to retry a method that doesn't exist
|
57
|
+
##box.exception_hook(Rye::CommandNotFound, &rbox_exception_handler)
|
58
|
+
|
59
|
+
box
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
# Create an instance of Rye::Set from a list of +hostnames+.
|
65
|
+
# +hostnames+ can contain hostnames or Rudy::Machine objects.
|
66
|
+
# +opts+ is an optional Hash of options. See Rye::Box.initialize
|
67
|
+
#
|
68
|
+
# NOTE: Windows machines are skipped and not added to the set.
|
69
|
+
def create_set(hostnames, opts={})
|
70
|
+
hostnames ||= []
|
71
|
+
|
72
|
+
opts = {
|
73
|
+
:user => (current_machine_user).to_s,
|
74
|
+
:parallel => @@global.parallel
|
75
|
+
}.merge(opts)
|
76
|
+
set = ::Rye::Set.new current_machine_group, opts
|
77
|
+
|
78
|
+
opts.delete(:parallel) # Not used by Rye::Box.new
|
79
|
+
|
80
|
+
hostnames.each do |m|
|
81
|
+
|
82
|
+
if m.is_a?(Rudy::Machine)
|
83
|
+
m.refresh! if m.dns_public.nil? || m.dns_public.empty?
|
84
|
+
if m.dns_public.nil? || m.dns_public.empty?
|
85
|
+
ld "Cannot find public DNS for #{m.name} (continuing...)"
|
86
|
+
rbox = self.create_box('nohost', opts)
|
87
|
+
else
|
88
|
+
ld [:dns_public, m.dns_public, m.instid]
|
89
|
+
rbox = self.create_box(m.dns_public, opts)
|
90
|
+
end
|
91
|
+
rbox.stash = m # Store the machine instance in the stash
|
92
|
+
rbox.nickname = m.name
|
93
|
+
else
|
94
|
+
# Otherwise we assume it's a hostname
|
95
|
+
rbox = self.create_box(m)
|
96
|
+
end
|
97
|
+
rbox.add_key user_keypairpath(opts[:user])
|
98
|
+
set.add_box rbox
|
99
|
+
end
|
100
|
+
|
101
|
+
ld "Machines Set: %s" % [set.empty? ? '[empty]' : set.inspect]
|
102
|
+
|
103
|
+
set
|
104
|
+
end
|
105
|
+
|
106
|
+
|
107
|
+
private
|
108
|
+
|
109
|
+
# Returns a formatted string for printing command info
|
110
|
+
def print_command(user, host, cmd)
|
111
|
+
#return if @@global.parallel
|
112
|
+
cmd ||= ""
|
113
|
+
cmd, user = cmd.to_s, user.to_s
|
114
|
+
prompt = user == "root" ? "#" : "$"
|
115
|
+
li ("%s@%s%s %s" % [user, host, prompt, cmd.bright])
|
116
|
+
end
|
117
|
+
|
118
|
+
def print_response(rap)
|
119
|
+
# Non zero exit codes raise exceptions so
|
120
|
+
# the erorrs have already been handled.
|
121
|
+
return if rap.exit_code != 0
|
122
|
+
|
123
|
+
if @@global.parallel
|
124
|
+
cmd, user = cmd.to_s, user.to_s
|
125
|
+
prompt = user == "root" ? "#" : "$"
|
126
|
+
li "%s@%s%s %s%s%s" % [rap.box.user, rap.box.nickname, prompt, rap.cmd.bright, $/, rap.stdout.inspect]
|
127
|
+
unless rap.stderr.empty?
|
128
|
+
le "#{rap.box.nickname}: " << rap.stderr.join("#{rap.box.nickname}: ")
|
129
|
+
end
|
130
|
+
else
|
131
|
+
li ' ' << rap.stdout.join("#{$/} ") if !rap.stdout.empty?
|
132
|
+
colour = rap.exit_code != 0 ? :red : :normal
|
133
|
+
unless rap.stderr.empty?
|
134
|
+
le (" STDERR " << '-'*38).color(colour).bright
|
135
|
+
le " " << rap.stderr.join("#{$/} ").color(colour)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
|
141
|
+
def rbox_exception_handler
|
142
|
+
Proc.new do |ex, cmd, user, host, nickname|
|
143
|
+
print_exception(user, host, cmd, nickname, ex)
|
144
|
+
unless @@global.parallel
|
145
|
+
choice = Annoy.get_user_input('(S)kip (R)etry (F)orce (A)bort: ', nil, 3600) || ''
|
146
|
+
if choice.match(/\AS/i)
|
147
|
+
:skip
|
148
|
+
elsif choice.match(/\AR/i)
|
149
|
+
:retry # Tells Rye::Box#run_command to retry
|
150
|
+
elsif choice.match(/\AF/i)
|
151
|
+
@@global.force = true
|
152
|
+
:retry
|
153
|
+
else
|
154
|
+
exit 12
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
def print_exception(user, host, cmd, nickname, ex)
|
161
|
+
prefix = @@global.parallel ? "#{nickname}: #{cmd}: " : ""
|
162
|
+
if ex.is_a?(::Rye::CommandError)
|
163
|
+
le prefix << ex.message.color(:red)
|
164
|
+
else
|
165
|
+
le prefix << "#{ex.class}: #{ex.message}".color(:red)
|
166
|
+
end
|
167
|
+
le *ex.backtrace if @@global.verbose > 2
|
168
|
+
end
|
169
|
+
|
170
|
+
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
@@ -46,7 +46,8 @@ module Rudy; module Routines; module Handlers;
|
|
46
46
|
|
47
47
|
# The error doesn't apply to the local Rye::Box instance
|
48
48
|
if robj.is_a?(Rye::Set) && !File.exists?(user_keypairpath(user) || '')
|
49
|
-
|
49
|
+
# TODO: This prints always even if an account is authorized with different keys.
|
50
|
+
#le "Cannot find key for #{user}: #{user_keypairpath(user)}"
|
50
51
|
end
|
51
52
|
|
52
53
|
if user.to_s != robj.user
|
@@ -4,11 +4,11 @@ module Rudy; module Routines;
|
|
4
4
|
|
5
5
|
def init(*args)
|
6
6
|
@machines = Rudy::Machines.list || []
|
7
|
-
@@rset =
|
7
|
+
@@rset = Rudy::Routines::Handlers::RyeTools.create_set @machines
|
8
8
|
end
|
9
9
|
|
10
10
|
def execute
|
11
|
-
|
11
|
+
li "Executing routine: #{@name}"
|
12
12
|
return @machines unless run?
|
13
13
|
Rudy::Routines::Handlers::Depends.execute_all @before
|
14
14
|
Rudy::Routines.runner(@routine, @@rset, @@lbox, @argv)
|
data/lib/rudy/routines/reboot.rb
CHANGED
@@ -12,7 +12,7 @@ module Rudy; module Routines;
|
|
12
12
|
def init(*args)
|
13
13
|
@routine ||= {}
|
14
14
|
@machines = Rudy::Machines.list
|
15
|
-
@@rset =
|
15
|
+
@@rset = Rudy::Routines::Handlers::RyeTools.create_set @machines
|
16
16
|
end
|
17
17
|
|
18
18
|
# Startup routines run in the following order:
|
@@ -24,7 +24,7 @@ module Rudy; module Routines;
|
|
24
24
|
# * all other actions
|
25
25
|
# * after dependencies
|
26
26
|
def execute
|
27
|
-
|
27
|
+
li "Executing routine: #{@name}"
|
28
28
|
ld "[this is a generic routine]" if @routine.empty?
|
29
29
|
|
30
30
|
if run?
|
@@ -10,7 +10,7 @@ module Rudy; module Routines;
|
|
10
10
|
|
11
11
|
def init(*args)
|
12
12
|
@machines = Rudy::Machines.list || []
|
13
|
-
@@rset =
|
13
|
+
@@rset = Rudy::Routines::Handlers::RyeTools.create_set @machines
|
14
14
|
@routine ||= {}
|
15
15
|
end
|
16
16
|
|
@@ -21,7 +21,7 @@ module Rudy; module Routines;
|
|
21
21
|
# * after_local (if present)
|
22
22
|
# * after dependencies
|
23
23
|
def execute
|
24
|
-
|
24
|
+
li "Executing routine: #{@name}"
|
25
25
|
ld "[this is a generic routine]" if @routine.empty?
|
26
26
|
|
27
27
|
# We need to remove after_local so the runner doesn't see it
|
@@ -20,7 +20,7 @@ module Rudy; module Routines;
|
|
20
20
|
# * all other actions
|
21
21
|
# * after dependencies
|
22
22
|
def execute
|
23
|
-
|
23
|
+
li "Executing routine: #{@name}"
|
24
24
|
ld "[this is a generic routine]" if @routine.empty?
|
25
25
|
|
26
26
|
|
@@ -59,9 +59,11 @@ module Rudy; module Routines;
|
|
59
59
|
# NOTE: Expect errors if there are no machines.
|
60
60
|
Rudy::Routines.rescue {
|
61
61
|
@machines = run? ? Rudy::Machines.create : Rudy::Machines.list
|
62
|
-
@@rset =
|
62
|
+
@@rset = Rudy::Routines::Handlers::RyeTools.create_set @machines
|
63
63
|
}
|
64
64
|
|
65
|
+
sleep 1 # SimpleDB eventual consistency
|
66
|
+
|
65
67
|
Rudy::Routines.rescue {
|
66
68
|
if !Rudy::Routines::Handlers::Host.is_running? @@rset
|
67
69
|
a = @@rset.boxes.select { |box| !box.stash.instance_running? }
|
data/rudy.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
@spec = Gem::Specification.new do |s|
|
2
2
|
s.name = "rudy"
|
3
3
|
s.rubyforge_project = 'rudy'
|
4
|
-
s.version = "0.9.
|
4
|
+
s.version = "0.9.2"
|
5
5
|
s.summary = "Rudy: Not your grandparents' EC2 deployment tool."
|
6
6
|
s.description = s.summary
|
7
7
|
s.author = "Delano Mandelbaum"
|
8
8
|
s.email = "delano@solutious.com"
|
9
|
-
s.homepage = "http://
|
9
|
+
s.homepage = "http://solutious.com/projects/rudy/"
|
10
10
|
|
11
11
|
s.extra_rdoc_files = %w[README.rdoc Rudyfile LICENSE.txt CHANGES.txt]
|
12
12
|
s.has_rdoc = true
|
@@ -16,19 +16,19 @@
|
|
16
16
|
|
17
17
|
s.executables = %w[rudy rudy-ec2 rudy-sdb rudy-s3]
|
18
18
|
|
19
|
-
s.add_dependency 'rye', '>= 0.8.
|
19
|
+
s.add_dependency 'rye', '>= 0.8.9'
|
20
20
|
s.add_dependency 'attic', '>= 0.4.0'
|
21
21
|
s.add_dependency 'annoy', '>= 0.5.5'
|
22
22
|
s.add_dependency 'drydock', '>= 0.6.6'
|
23
23
|
s.add_dependency 'caesars', '>= 0.7.3'
|
24
|
-
s.add_dependency 'sysinfo', '>= 0.
|
24
|
+
s.add_dependency 'sysinfo', '>= 0.7.0'
|
25
25
|
s.add_dependency 'gibbler', '>= 0.6.0'
|
26
26
|
s.add_dependency 'tryouts', '>= 0.8.4'
|
27
27
|
s.add_dependency 'storable', '>= 0.5.6'
|
28
28
|
|
29
|
-
s.add_dependency 'aws-s3', '>= 0.6.1'
|
30
|
-
s.add_dependency 'highline', '>= 1.5.1'
|
31
|
-
s.add_dependency 'amazon-ec2', '>= 0.
|
29
|
+
s.add_dependency 'aws-s3', '>= 0.6.1'
|
30
|
+
s.add_dependency 'highline', '>= 1.5.1'
|
31
|
+
s.add_dependency 'amazon-ec2', '>= 0.5.0'
|
32
32
|
|
33
33
|
# = MANIFEST =
|
34
34
|
# git ls-files
|
@@ -42,7 +42,10 @@
|
|
42
42
|
bin/rudy-ec2
|
43
43
|
bin/rudy-s3
|
44
44
|
bin/rudy-sdb
|
45
|
+
examples/authorize.rb
|
45
46
|
examples/gem-test.rb
|
47
|
+
examples/solaris.rb
|
48
|
+
examples/windows.rb
|
46
49
|
lib/rudy.rb
|
47
50
|
lib/rudy/aws.rb
|
48
51
|
lib/rudy/aws/ec2.rb
|
@@ -63,6 +66,7 @@
|
|
63
66
|
lib/rudy/cli/aws/ec2/candy.rb
|
64
67
|
lib/rudy/cli/aws/ec2/groups.rb
|
65
68
|
lib/rudy/cli/aws/ec2/images.rb
|
69
|
+
lib/rudy/cli/aws/ec2/info.rb
|
66
70
|
lib/rudy/cli/aws/ec2/instances.rb
|
67
71
|
lib/rudy/cli/aws/ec2/keypairs.rb
|
68
72
|
lib/rudy/cli/aws/ec2/snapshots.rb
|
@@ -79,11 +83,13 @@
|
|
79
83
|
lib/rudy/cli/config.rb
|
80
84
|
lib/rudy/cli/disks.rb
|
81
85
|
lib/rudy/cli/execbase.rb
|
86
|
+
lib/rudy/cli/images.rb
|
87
|
+
lib/rudy/cli/info.rb
|
88
|
+
lib/rudy/cli/keypairs.rb
|
82
89
|
lib/rudy/cli/machines.rb
|
83
90
|
lib/rudy/cli/metadata.rb
|
84
91
|
lib/rudy/cli/networks.rb
|
85
92
|
lib/rudy/cli/routines.rb
|
86
|
-
lib/rudy/cli/status.rb
|
87
93
|
lib/rudy/config.rb
|
88
94
|
lib/rudy/config/objects.rb
|
89
95
|
lib/rudy/disks.rb
|
@@ -108,6 +114,7 @@
|
|
108
114
|
lib/rudy/routines/handlers/host.rb
|
109
115
|
lib/rudy/routines/handlers/keypair.rb
|
110
116
|
lib/rudy/routines/handlers/machines.rb
|
117
|
+
lib/rudy/routines/handlers/rye.rb
|
111
118
|
lib/rudy/routines/handlers/script.rb
|
112
119
|
lib/rudy/routines/handlers/user.rb
|
113
120
|
lib/rudy/routines/passthrough.rb
|