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.
Files changed (84) hide show
  1. data/CHANGES.txt +32 -17
  2. data/README.rdoc +74 -40
  3. data/bin/rudy +66 -10
  4. data/bin/rudy-ec2 +3 -1
  5. data/examples/authorize.rb +15 -0
  6. data/examples/gem-test.rb +11 -5
  7. data/examples/solaris.rb +35 -0
  8. data/examples/windows.rb +101 -0
  9. data/lib/rudy.rb +7 -1
  10. data/lib/rudy/aws.rb +2 -2
  11. data/lib/rudy/aws/ec2.rb +29 -22
  12. data/lib/rudy/aws/ec2/group.rb +1 -1
  13. data/lib/rudy/aws/ec2/image.rb +1 -29
  14. data/lib/rudy/aws/ec2/instance.rb +4 -32
  15. data/lib/rudy/aws/ec2/keypair.rb +1 -6
  16. data/lib/rudy/aws/ec2/snapshot.rb +2 -20
  17. data/lib/rudy/aws/ec2/volume.rb +11 -19
  18. data/lib/rudy/aws/ec2/zone.rb +1 -6
  19. data/lib/rudy/aws/sdb.rb +1 -1
  20. data/lib/rudy/cli/aws/ec2/addresses.rb +4 -10
  21. data/lib/rudy/cli/aws/ec2/groups.rb +0 -1
  22. data/lib/rudy/cli/aws/ec2/images.rb +1 -4
  23. data/lib/rudy/cli/aws/ec2/info.rb +63 -0
  24. data/lib/rudy/cli/aws/ec2/instances.rb +3 -5
  25. data/lib/rudy/cli/aws/ec2/keypairs.rb +3 -5
  26. data/lib/rudy/cli/aws/ec2/snapshots.rb +2 -6
  27. data/lib/rudy/cli/aws/ec2/zones.rb +2 -4
  28. data/lib/rudy/cli/backups.rb +20 -9
  29. data/lib/rudy/cli/base.rb +60 -3
  30. data/lib/rudy/cli/candy.rb +1 -1
  31. data/lib/rudy/cli/disks.rb +65 -7
  32. data/lib/rudy/cli/execbase.rb +0 -2
  33. data/lib/rudy/cli/images.rb +97 -0
  34. data/lib/rudy/cli/info.rb +48 -0
  35. data/lib/rudy/cli/keypairs.rb +43 -0
  36. data/lib/rudy/cli/machines.rb +41 -36
  37. data/lib/rudy/cli/networks.rb +68 -0
  38. data/lib/rudy/cli/routines.rb +3 -10
  39. data/lib/rudy/config/objects.rb +0 -1
  40. data/lib/rudy/disks.rb +4 -0
  41. data/lib/rudy/global.rb +1 -1
  42. data/lib/rudy/huxtable.rb +9 -3
  43. data/lib/rudy/machines.rb +1 -1
  44. data/lib/rudy/metadata.rb +4 -1
  45. data/lib/rudy/metadata/backup.rb +2 -2
  46. data/lib/rudy/metadata/disk.rb +7 -4
  47. data/lib/rudy/metadata/machine.rb +66 -2
  48. data/lib/rudy/routines.rb +2 -1
  49. data/lib/rudy/routines/base.rb +4 -157
  50. data/lib/rudy/routines/handlers/base.rb +6 -3
  51. data/lib/rudy/routines/handlers/disks.rb +127 -42
  52. data/lib/rudy/routines/handlers/group.rb +45 -10
  53. data/lib/rudy/routines/handlers/host.rb +16 -10
  54. data/lib/rudy/routines/handlers/keypair.rb +26 -10
  55. data/lib/rudy/routines/handlers/rye.rb +171 -0
  56. data/lib/rudy/routines/handlers/script.rb +2 -1
  57. data/lib/rudy/routines/passthrough.rb +2 -2
  58. data/lib/rudy/routines/reboot.rb +2 -2
  59. data/lib/rudy/routines/shutdown.rb +2 -2
  60. data/lib/rudy/routines/startup.rb +4 -2
  61. data/rudy.gemspec +17 -10
  62. data/tryouts/10_require_time/10_rudy_tryouts.rb +1 -1
  63. data/tryouts/12_config/20_defaults_tryouts.rb +1 -1
  64. data/tryouts/12_config/40_machines_tryouts.rb +1 -1
  65. data/tryouts/15_huxtable/20_user_tryouts.rb +1 -1
  66. data/tryouts/25_ec2/10_keypairs_tryouts.rb +1 -0
  67. data/tryouts/30_metadata/10_include_tryouts.rb +1 -1
  68. data/tryouts/30_metadata/13_object_tryouts.rb +4 -0
  69. data/tryouts/30_metadata/50_disk_tryouts.rb +4 -2
  70. data/tryouts/30_metadata/51_disk_digest_tryouts.rb +1 -1
  71. data/tryouts/30_metadata/53_disk_list_tryouts.rb +2 -1
  72. data/tryouts/30_metadata/56_disk_volume_tryouts.rb +1 -1
  73. data/tryouts/30_metadata/60_backup_tryouts.rb +4 -2
  74. data/tryouts/30_metadata/63_backup_list_tryouts.rb +1 -1
  75. data/tryouts/30_metadata/64_backup_disk_tryouts.rb +3 -1
  76. data/tryouts/30_metadata/66_backup_snapshot_tryouts.rb +1 -1
  77. data/tryouts/30_metadata/70_machine_tryouts.rb +5 -2
  78. data/tryouts/30_metadata/73_machine_list_tryouts.rb +1 -1
  79. data/tryouts/30_metadata/76_machine_instance_tryouts.rb +15 -3
  80. data/tryouts/30_metadata/77_machines_tryouts.rb +1 -1
  81. data/tryouts/40_routines/10_keypair_handler_tryouts.rb +6 -5
  82. data/tryouts/40_routines/11_group_handler_tryouts.rb +1 -1
  83. metadata +14 -7
  84. data/lib/rudy/cli/status.rb +0 -60
@@ -5,10 +5,16 @@ module Rudy::Routines::Handlers;
5
5
  extend self
6
6
 
7
7
  ACTIONS = [:create, :destroy, :archive, :mount, :restore,
8
- :attach, :detach, :mount, :umount].freeze
8
+ :attach, :detach, :mount, :umount, :fstype].freeze
9
9
 
10
10
  Rudy::Routines.add_handler :disks, self
11
11
 
12
+ Rye::Cmd.add_command(:rudy_rm, 'rm')
13
+ Rye::Cmd.add_command(:rudy_mkfs, 'mkfs')
14
+ Rye::Cmd.add_command(:rudy_blkid, 'blkid')
15
+ Rye::Cmd.add_command(:rudy_format, 'C:/windows/system32/format.com')
16
+ Rye::Cmd.add_command(:rudy_diskpart, 'diskpart')
17
+
12
18
  def raise_early_exceptions(type, batch, rset, lbox, argv=nil)
13
19
 
14
20
  end
@@ -34,43 +40,54 @@ module Rudy::Routines::Handlers;
34
40
 
35
41
  def execute(type, routine, rset, lbox, argv=nil)
36
42
  original_user = rset.user
37
- rset.add_key user_keypairpath('root')
38
- rset.switch_user 'root'
39
-
40
- # We need to add mkfs since it's not enabled by default.
41
- # We prepend the command with rudy_ so we can delete it.
42
- Rye::Cmd.add_command(:rudy_mkfs, 'mkfs')
43
+ rset.add_key user_keypairpath(current_machine_user)
44
+ rset.switch_user current_machine_user
43
45
 
44
46
  routine.each_pair do |action, disks|
45
47
  unless respond_to?(action.to_sym)
46
- Rudy::Huxtable.le %Q(DiskHelper: unknown action "#{action}")
48
+ Rudy::Huxtable.le %Q(DiskHandler: unknown action "#{action}")
47
49
  next
48
50
  end
49
51
  # A quick hack to take advantage of the threading in Rye::Set.
50
52
  # The action method does not run in the context of a Rye::Box
51
53
  # object so we need to send rset as an argument.
52
54
  rset.batch do
55
+ # Windows EC2 instances have 2 disks by default (C: and D:)
56
+ volumes = self.stash.attached_volumes
53
57
  disks.each_pair do |path, props|
54
58
  # self contains the current instance of Rye::Box.
55
59
  disk = Rudy::Disk.new(self.stash.position, path, props)
56
- Rudy::Routines::Handlers::Disks.send(action, self, disk)
60
+ disk.refresh! if disk.exists? # We need the volume ID if available
61
+ # don't include the current disk in the count.
62
+ volumes.reject! { |v| v.awsid == disk.volid } if disk.volid && disk.volume_attached?
63
+ disk_index = volumes.size + 2
64
+ Rudy::Routines::Handlers::Disks.send(action, self, disk, disk_index)
57
65
  end
58
66
  end
59
67
 
60
68
  end
61
69
 
62
- Rye::Cmd.remove_command(:rudy_mkfs)
63
-
64
70
  rset.switch_user original_user
65
71
  end
66
72
 
73
+ def fstype(rbox, disk, index)
74
+
75
+ raise Rudy::Metadata::UnknownObject, disk.name unless disk.exists?
76
+ disk.refresh!
77
+
78
+ #p rbox.rudy_blkid :s, 'TYPE', :o, 'value', disk.device
79
+
80
+ end
81
+
67
82
 
68
- def create(rbox, disk)
83
+ def create(rbox, disk, index)
69
84
  if disk.exists?
70
85
  puts "Disk found: #{disk.name}"
71
86
  disk.refresh!
72
87
  end
73
88
 
89
+ disk.index = index # Needed for windows
90
+
74
91
  unless @@global.force
75
92
  raise Rudy::Disks::AlreadyAttached, disk.name if disk.volume_attached?
76
93
  end
@@ -83,25 +100,27 @@ module Rudy::Routines::Handlers;
83
100
  }
84
101
  end
85
102
 
86
- attach rbox, disk unless disk.volume_attached?
87
- format rbox, disk if disk.raw?
88
- mount rbox, disk unless disk.mounted?
103
+ attach rbox, disk, index unless disk.volume_attached?
104
+ format rbox, disk, index if disk.raw?
105
+ mount rbox, disk, index unless disk.mounted?
89
106
 
90
107
  disk.save :replace
91
108
  end
92
109
 
93
110
 
94
111
 
95
- def detach(rbox, disk)
112
+ def detach(rbox, disk, index)
96
113
 
97
114
  raise Rudy::Metadata::UnknownObject, disk.name unless disk.exists?
98
115
  disk.refresh!
99
116
 
100
- raise Rudy::Disks::NotAttached, disk.name if !disk.volume_attached?
117
+ unless @@global.force
118
+ raise Rudy::Disks::NotAttached, disk.name unless disk.volume_attached?
119
+ end
101
120
 
102
- umount rbox, disk if disk.mounted?
121
+ umount rbox, disk, index if disk.mounted?
103
122
  raise Rudy::Disks::InUse, disk.name if disk.mounted?
104
-
123
+
105
124
  msg = "Detaching #{disk.volid}..."
106
125
  disk.volume_detach
107
126
  Rudy::Utils.waiter(2, 60, STDOUT, msg) {
@@ -110,25 +129,48 @@ module Rudy::Routines::Handlers;
110
129
 
111
130
  end
112
131
 
113
- def attach(rbox, disk)
132
+ def attach(rbox, disk, index)
133
+
134
+ unless disk.volume_exists?
135
+ msg = "Creating volume... "
136
+ disk.create
137
+ Rudy::Utils.waiter(2, 60, STDOUT, msg) {
138
+ disk.volume_available?
139
+ }
140
+ end
114
141
 
115
142
  raise Rudy::Metadata::UnknownObject, disk.name unless disk.exists?
116
143
  disk.refresh!
117
144
 
118
- raise Rudy::Disks::AlreadyAttached, disk.name if disk.volume_attached?
145
+ unless @@global.force
146
+ raise Rudy::Disks::AlreadyAttached, disk.name if disk.volume_attached?
147
+ end
148
+
149
+ devices = rbox.stash.attached_volumes.collect { |v| v.device }
150
+ if devices.member? disk.device
151
+ li "Device ID #{disk.device} is taken. Using #{devices.sort.last.succ}"
152
+ disk.device = devices.sort.last.succ
153
+ disk.save :replace
154
+ end
119
155
 
120
156
  msg = "Attaching #{disk.volid} to #{rbox.stash.instid}... "
121
157
  disk.volume_attach(rbox.stash.instid)
122
- Rudy::Utils.waiter(2, 10, STDOUT, msg) {
158
+ Rudy::Utils.waiter(3, 30, STDOUT, msg) {
123
159
  disk.volume_attached?
124
160
  }
125
161
 
126
162
  end
127
163
 
128
- def mount(rbox, disk)
164
+ def mount(rbox, disk, index)
129
165
 
130
166
  raise Rudy::Metadata::UnknownObject, disk.name unless disk.exists?
131
167
  disk.refresh!
168
+
169
+ if rbox.stash.windows?
170
+ Rudy::Huxtable.li "Skipping for Windows"
171
+ return
172
+ end
173
+
132
174
  attach rbox, disk unless disk.volume_attached?
133
175
 
134
176
  unless @@global.force
@@ -137,35 +179,42 @@ module Rudy::Routines::Handlers;
137
179
  raise Rudy::Disks::AlreadyMounted, disk.name if disk.mounted?
138
180
  end
139
181
 
140
- rbox.mkdir(:p, disk.path)
141
-
142
182
  puts "Mounting at #{disk.path}... "
143
-
183
+
184
+
185
+ rbox.mkdir(:p, disk.path)
144
186
  rbox.mount(:t, disk.fstype, disk.device, disk.path)
145
187
  disk.mounted = true
146
188
  disk.save :replace
147
189
  sleep 1
190
+
148
191
  end
149
192
 
150
193
 
151
- def umount(rbox, disk)
194
+ def umount(rbox, disk, index)
195
+
152
196
  raise Rudy::Metadata::UnknownObject, disk.name unless disk.exists?
153
197
  disk.refresh!
154
198
 
155
- raise Rudy::Disks::NotAttached, disk.name if !disk.volume_attached?
156
- if @@global.force
199
+ unless @@global.force
200
+ raise Rudy::Disks::NotAttached, disk.name if !disk.volume_attached?
157
201
  raise Rudy::Disks::NotMounted, disk.name if !disk.mounted?
158
202
  end
159
203
 
160
204
  puts "Unmounting #{disk.path}... "
161
- rbox.umount(disk.path)
205
+
206
+ unless rbox.nil? || rbox.stash.windows?
207
+ rbox.umount(disk.path)
208
+ end
209
+
162
210
  disk.mounted = false
163
211
  disk.save :replace
164
212
  sleep 2
213
+
165
214
  end
166
215
  alias_method :unmount, :umount
167
216
 
168
- def format(rbox, disk)
217
+ def format(rbox, disk, index)
169
218
  raise Rudy::Metadata::UnknownObject, disk.name unless disk.exists?
170
219
  disk.refresh!
171
220
 
@@ -177,20 +226,32 @@ module Rudy::Routines::Handlers;
177
226
  raise Rudy::Disks::AlreadyFormatted, disk.name if !disk.raw?
178
227
  end
179
228
 
180
- disk.fstype = 'ext3' if disk.fstype.nil? || disk.fstype.empty?
229
+ if disk.fstype.nil? || disk.fstype.empty?
230
+ disk.fstype = rbox.stash.default_fstype
231
+ end
232
+
233
+ print "Creating #{disk.fstype} filesystem for #{disk.path}... "
234
+ if rbox.stash.windows?
235
+ puts "(index: #{index})"
236
+ windows_diskpart_partition rbox, disk, index
237
+ disk.mounted = true
238
+ else
239
+ puts $/
240
+ rbox.rudy_mkfs(:t, disk.fstype, :F, disk.device)
241
+ end
181
242
 
182
- puts "Creating #{disk.fstype} filesystem for #{disk.device}... "
183
- rbox.rudy_mkfs(:t, disk.fstype, :F, disk.device)
184
243
  disk.raw = false
185
244
  disk.save :replace
245
+ sleep 1
246
+ disk
186
247
  end
187
248
 
188
- def destroy(rbox, disk)
249
+ def destroy(rbox, disk, index)
189
250
  raise Rudy::Metadata::UnknownObject, disk.name unless disk.exists?
190
251
  disk.refresh!
191
252
 
192
- umount rbox, disk if disk.mounted?
193
- detach rbox, disk if disk.volume_attached?
253
+ umount rbox,disk,index if disk.mounted? && !rbox.nil? && !rbox.stash.windows?
254
+ detach rbox,disk,index if disk.volume_attached?
194
255
 
195
256
  unless @@global.force
196
257
  raise Rudy::Disks::InUse, disk.name if disk.volume_attached?
@@ -200,7 +261,7 @@ module Rudy::Routines::Handlers;
200
261
  disk.destroy
201
262
  end
202
263
 
203
- def archive(rbox, disk)
264
+ def archive(rbox, disk, index)
204
265
  raise Rudy::Metadata::UnknownObject, disk.name unless disk.exists?
205
266
  disk.refresh!
206
267
 
@@ -210,7 +271,7 @@ module Rudy::Routines::Handlers;
210
271
  puts "Created backup: #{back.name}"
211
272
  end
212
273
 
213
- def restore(rbox, disk)
274
+ def restore(rbox, disk, index)
214
275
 
215
276
  if disk.exists?
216
277
  puts "Disk found: #{disk.name}"
@@ -222,7 +283,11 @@ module Rudy::Routines::Handlers;
222
283
  end
223
284
 
224
285
  latest_backup = disk.backups.last
225
- latest_backup.fstype = 'ext3' if latest_backup.fstype.nil? || latest_backup.fstype.empty?
286
+
287
+ if latest_backup.fstype.nil? || latest_backup.fstype.empty?
288
+ latest_backup.fstype = rbox.stash.default_fstype
289
+ end
290
+
226
291
  disk.size, disk.fstype = latest_backup.size, latest_backup.fstype
227
292
 
228
293
  puts "Backup found: #{latest_backup.name}"
@@ -237,13 +302,33 @@ module Rudy::Routines::Handlers;
237
302
  disk.save :replace
238
303
  end
239
304
 
240
- attach rbox, disk unless disk.volume_attached?
241
- mount rbox, disk unless disk.mounted?
305
+ attach rbox, disk, index unless disk.volume_attached?
306
+ mount rbox, disk, index unless disk.mounted?
242
307
 
243
308
  disk.save :replace
244
309
 
245
310
  end
246
311
 
312
+ private
313
+
314
+ # See:
315
+ # * http://social.technet.microsoft.com/Forums/en-US/winserversetup/thread/2cfbaae1-6e33-4197-bb71-63434a34eb3c
316
+ # * http://technet.microsoft.com/en-us/library/cc766465(WS.10).aspx
317
+ def windows_diskpart_partition(rbox, disk, disk_num)
318
+ rbox.quietly { rudy_rm :f, 'diskpart-script' }
319
+ rbox.file_append 'diskpart-script', %Q{
320
+ select disk #{disk_num}
321
+ clean
322
+ create partition primary
323
+ select partition 1
324
+ active
325
+ assign letter=#{disk.path.tr(':/', '')}
326
+ exit}
327
+ rbox.rudy_diskpart '/s', 'diskpart-script'
328
+ rbox.quietly { rudy_rm :f, 'diskpart-script' }
329
+ rbox.rudy_format disk.path, '/V:RUDY', "/FS:#{disk.fstype}", '/Q', '/Y'
330
+ end
331
+
247
332
 
248
333
  end
249
334
  end
@@ -4,13 +4,24 @@ module Rudy; module Routines; module Handlers;
4
4
  include Rudy::Routines::Handlers::Base
5
5
  extend self
6
6
 
7
- ##Rudy::Routines.add_handler :machines, self
7
+ Rudy::Routines.add_handler :network, self
8
8
 
9
9
 
10
- def raise_early_exceptions(name=nil)
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(name=nil, addresses=nil, ports=nil)
22
- name ||= current_group_name
23
- addresses ||= [Rudy::Utils::external_ip_address]
24
- if ports.nil?
25
- ports = current_machine_os.to_s == 'win32' ? [[3389,3389]] : [[22,22]]
26
- end
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
- Rudy::Utils.waiter(3, 240, Rudy::Huxtable.logger, msg, 0) {
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
- unless (rbox.stash.os || '').to_s == 'win32' # No SSH daemon in windows
40
- msg = "Waiting for SSH (#{port}) on #{rbox.nickname} ..."
41
- Rudy::Utils.waiter(2, 60, STDOUT, msg, 0) {
42
- Rudy::Utils.service_available?(rbox.stash.dns_public, port)
43
- }
44
- end
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
- if hn != :default
62
- hn = self.stash.name if hn == :rudy
63
- self.quietly { hostname(hn) }
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