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
data/CHANGES.txt
CHANGED
@@ -1,6 +1,45 @@
|
|
1
1
|
RUDY, CHANGES
|
2
2
|
|
3
3
|
|
4
|
+
#### 0.9.3 (2009-08-26) ###########################
|
5
|
+
|
6
|
+
* FIXED: Updated dependencies in gemspec (Rye)
|
7
|
+
* FIXED: Local SSH pubkeys are now included when creating remote SSH
|
8
|
+
connections. This resolves the issues with creating and authorizing
|
9
|
+
a remote user then getting an authentication error.
|
10
|
+
|
11
|
+
|
12
|
+
#### 0.9.2 (2009-08-25) ###########################
|
13
|
+
|
14
|
+
* FIXED: Threading error in Net::HTTP by forcing a mutex during AWS::EC2 requests
|
15
|
+
* FIXED: errors when washing backups
|
16
|
+
* FIXED: Host.is_available? now checks port 3389 (Remote Desktop) for Windows instances. Closes GH-16
|
17
|
+
* FIXED: "rudy machines -T" now checks port 3389 for Windows instances. Closes GH-21
|
18
|
+
* FIXED: "rudy disks -l" doesn't display disks from a different zone. Closes GH-24
|
19
|
+
* FIXED: Rudy::Machine#refresh! now correctly refreshes metadata
|
20
|
+
* FIXED: startup, shutdown, and reboot routines don't run correctly as dependencies. Closes GH-25
|
21
|
+
* FIXED: Rogue "No machines configuration" error when accessing current_machine_address
|
22
|
+
* CHANGE: Increased AWS timeout to 30 seconds. Closes GH-19
|
23
|
+
* CHANGE: Increased boot wait time for windows instances to 500 seconds.
|
24
|
+
* CHANGE: Module names have changed from EC2 to AWS::EC2 in amazon-ec2 0.5 [Dominic Cleal]
|
25
|
+
* CHANGE: Rudy::Routines::Handlers::Disks.attach now creates a volume if the disk doesn't already have one.
|
26
|
+
* CHANGE: Standardized CLI outut for rudy-ec2 (except groups b/c of weird YAML error)
|
27
|
+
* CHANGE: Windows "os" is now referred to by :windows rather than :win32 (SysInfo 0.7)
|
28
|
+
* CHANGE: Renamed "rudy status" to "rudy info"
|
29
|
+
* ADDED: Rudy::Machine#get_console, Rudy::Machine#get_password
|
30
|
+
* ADDED: Rudy::Machine#windows?, Rudy::Machine#linux?, Rudy::Machine#solaris?, Rudy::Machine#os?
|
31
|
+
* ADDED: "rudy m -console" and "rudy m --password"
|
32
|
+
* ADDED: "rudy keypairs"
|
33
|
+
* ADDED: "rudy networks --authorize"
|
34
|
+
* ADDED: "rudy networks --revoke"
|
35
|
+
* ADDED: "rudy disks --create"
|
36
|
+
* ADDED: "rudy disks --destroy"
|
37
|
+
* ADDED: "rudy backups --create"
|
38
|
+
* ADDED: Support for attaching and formating disks in Windows.
|
39
|
+
* ADDED: "rudy-ec2 info"
|
40
|
+
* ADDED: Re-enabled networks action to routines config (see examples/jira.rb)
|
41
|
+
|
42
|
+
|
4
43
|
#### 0.9.1 (2009-08-05) ###########################
|
5
44
|
|
6
45
|
* FIXED: "rudy init" now exits with 0
|
@@ -95,7 +134,7 @@ NOTE: This is a significant re-write from 0.8 (primarily the routines, metadata)
|
|
95
134
|
|
96
135
|
#### 0.8.5 (2009-06-08) ###############################
|
97
136
|
|
98
|
-
* FIXED: Bug in
|
137
|
+
* FIXED: Bug in DiskHandler. mount method tried to attach when already attached.
|
99
138
|
* CHANGE: rudy config now displays account info (but keeps secret key hidden)
|
100
139
|
* CHANGE: defaults configuration has been removed from the default ~/.rudy/config.
|
101
140
|
It is now recommended to put it in the same place as machines, routines config.
|
@@ -326,19 +365,4 @@ NOTE: This is a complete re-write from 0.1
|
|
326
365
|
* Initial public release
|
327
366
|
|
328
367
|
|
329
|
-
#### TODO ###########################################
|
330
|
-
|
331
|
-
* TODO: Supply dns values in machines config
|
332
|
-
* TODO: Rudy::Routines::Arcade.
|
333
|
-
* install/uninstall: uses package management for the specific os impl
|
334
|
-
* compile: from source.
|
335
|
-
* e.g. rudy -a experimental install git (for ruby-unix-osx)
|
336
|
-
* How to handle multiple package managers?
|
337
|
-
* How to handle multiple app versions?
|
338
|
-
* TODO: http://opensoul.org/2009/6/24/capistrano-git-and-ssh-keys
|
339
|
-
* TODO: look for config file in ./.rudy, then ../.rudy, etc... (git-like)
|
340
|
-
* TODO: FIX: When shutting down, warns about disks even when they don't exist (CLI::Routines)
|
341
|
-
* TODO: Investigate SSH daemon on Windows
|
342
|
-
* TODO: Supply machines config to routines blocks with only the specific machine group context
|
343
|
-
* TODO: The output for rudy -v should become the default verbose level. -v should print the command output without the header. -vv should print the header. -vvv stays the same but also print full stack traces.
|
344
368
|
|
data/README.rdoc
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
<b>Not your grandparents' EC2 deployment tool.</b>
|
4
4
|
|
5
|
-
Rudy is a development and deployment tool for
|
5
|
+
Rudy is a development and deployment tool for EC2. It helps you build and maintain infrastructures by organizing them into groups of _zones_, _environments_, and _roles_. By making it quick and easy to build infrastructures, Rudy makes it feasible to run environments only for the time that you need them.
|
6
6
|
|
7
7
|
All configuration is organized into this hierarchy so you can define properties (machine image, machine type, IP address, etc...) by role, by environment, or by zone. You can also define routines for running shell commands and scripts, uploading files, creating disks and backups, etc... Routines are organized by hierarchy too so a "startup" routine can run one thing for your database machines and another thing for your application machines.
|
8
8
|
|
9
9
|
Rudy helps with other stuff too. Every machine can be given a hostname based on its zone, environment, role, and position (you can run multiple machines with the same role). These names look like this: <tt>m-us-east-1b-stage-app-01</tt>, but you can also assign your own names. Rudy also automatically creates a private keypair and security for each machine group (e.g. <tt>key-us-east-1b-stage-app</tt> and <tt>grp-us-east-1b-stage-app</tt>).
|
10
10
|
|
11
|
-
<b>Get-Started[http://solutious.com/projects/rudy/getting-started/] with Rudy
|
11
|
+
<b>Get-Started[http://solutious.com/projects/rudy/getting-started/] with Rudy now.</b>
|
12
12
|
|
13
13
|
|
14
14
|
== Configuration
|
@@ -21,7 +21,6 @@ Rudy is configured via several Ruby-based domain specific languages.
|
|
21
21
|
The machines configuration describes the "physical" characteristics of your infrastructure.
|
22
22
|
|
23
23
|
machines do
|
24
|
-
|
25
24
|
env :stage do # Define an environment
|
26
25
|
ami 'ami-e348af8a' # Specify a machine image
|
27
26
|
|
@@ -35,8 +34,8 @@ The machines configuration describes the "physical" characteristics of your infr
|
|
35
34
|
end
|
36
35
|
end
|
37
36
|
end
|
37
|
+
|
38
38
|
end
|
39
|
-
|
40
39
|
end
|
41
40
|
|
42
41
|
=== Routines
|
@@ -146,6 +145,7 @@ NOTE: <em>If you are not installing via RubyGems, you need to make sure the depe
|
|
146
145
|
* Linux: Ruby 1.8, 1.9, and JRuby 1.3+
|
147
146
|
* Windows: Ruby 1.8 and JRuby 1.3+ (Net::SSH does not run under Ruby 1.9)
|
148
147
|
* BSD: <i>Needs testing (any takers?)</i>
|
148
|
+
|
149
149
|
|
150
150
|
== More Info
|
151
151
|
|
@@ -159,10 +159,10 @@ NOTE: <em>If you are not installing via RubyGems, you need to make sure the depe
|
|
159
159
|
|
160
160
|
== Contributions
|
161
161
|
|
162
|
-
|
162
|
+
We encourage people to find unique and interesting ways to break and extend rudy.
|
163
163
|
|
164
164
|
* For bigger features please fork the git repo and send me a pull request.
|
165
|
-
* For small or single file changes, send
|
165
|
+
* For small or single file changes, send an email with details to: delano (@solutious.com)
|
166
166
|
|
167
167
|
|
168
168
|
== Thanks
|
data/bin/rudy
CHANGED
@@ -20,6 +20,8 @@ require 'rudy/cli'
|
|
20
20
|
# Command-line interface for /bin/rudy
|
21
21
|
class RudyCLI < Rudy::CLI::Base
|
22
22
|
|
23
|
+
debug :off
|
24
|
+
|
23
25
|
default :machines # when no command is provided
|
24
26
|
trawler :passthrough # unknown command names will forward here.
|
25
27
|
|
@@ -43,32 +45,53 @@ class RudyCLI < Rudy::CLI::Base
|
|
43
45
|
usage "rudy machines"
|
44
46
|
usage "rudy machines -l"
|
45
47
|
usage "rudy machines -U"
|
46
|
-
usage "rudy machines -A"
|
47
|
-
usage "rudy machines -
|
48
|
-
usage "rudy machines -
|
49
|
-
|
48
|
+
usage "rudy machines -A [static ip address]"
|
49
|
+
usage "rudy machines -N"
|
50
|
+
usage "rudy machines -T"
|
51
|
+
usage "rudy machines -P"
|
52
|
+
usage "rudy machines -O"
|
50
53
|
action :W, :wash, "Wash machine metadata"
|
51
54
|
action :T, :available, "Test availablity"
|
52
55
|
action :U, :update, "Update machines based on configuration"
|
53
56
|
action :A, :associate, "Associate static IP addresses or display existing ones"
|
54
57
|
action :N, :disassociate, "Disassociate static IP addresses"
|
58
|
+
action :P, :password, "Display admin password (Windows only)"
|
59
|
+
action :O, :console, "Display console output"
|
60
|
+
option :l, :all, "Display machines for all environments and roles"
|
55
61
|
command :machines => Rudy::CLI::Machines
|
56
62
|
command_alias :machines, :m
|
57
63
|
|
64
|
+
about "View Keypairs"
|
65
|
+
usage "rudy keypairs"
|
66
|
+
#usage "rudy keypairs -A"
|
67
|
+
usage "rudy keypairs -S"
|
68
|
+
action :A, :add, "Add a keypair"
|
69
|
+
action :S, :show, "Show a private key"
|
70
|
+
command :keypairs => Rudy::CLI::Keypairs
|
71
|
+
command_alias :keypairs, :k
|
72
|
+
|
58
73
|
about "View Disks"
|
59
74
|
usage "rudy disks"
|
60
75
|
usage "rudy disks -l"
|
61
|
-
|
76
|
+
usage "rudy disks -C -s 1 /path/2/mount"
|
77
|
+
option :s, :size, Integer, "Volume size (GB)"
|
78
|
+
option :d, :device, String, "Device ID"
|
79
|
+
option :f, :fstype, String, "Filesystem type"
|
62
80
|
option :b, :backups, "Display backups"
|
63
81
|
option :l, :all, "Display all disks"
|
82
|
+
action :C, :create, "Create disk"
|
83
|
+
action :D, :destroy, "Destroy disk"
|
84
|
+
action :W, :wash, "Wash disk metadata"
|
64
85
|
command :disks => Rudy::CLI::Disks
|
65
86
|
command_alias :disks, :d
|
66
87
|
|
67
88
|
about "View Backups"
|
68
89
|
usage "rudy backups"
|
69
90
|
usage "rudy backups -l"
|
70
|
-
|
91
|
+
usage "rudy backups -C /disk/mount/point"
|
71
92
|
option :l, :all, "Display all backups"
|
93
|
+
action :W, :wash, "Wash backup metadata"
|
94
|
+
action :C, :create, "Create backup"
|
72
95
|
command :backups => Rudy::CLI::Backups
|
73
96
|
command_alias :backups, :b
|
74
97
|
|
@@ -82,16 +105,27 @@ class RudyCLI < Rudy::CLI::Base
|
|
82
105
|
argv :oid
|
83
106
|
command :metadata => Rudy::CLI::Metadata
|
84
107
|
|
85
|
-
about "View Network configuration
|
108
|
+
about "View Network configuration"
|
86
109
|
usage "rudy networks"
|
87
110
|
usage "rudy networks -L"
|
88
111
|
usage "rudy networks -L -i"
|
89
112
|
usage "rudy networks -L -e"
|
90
113
|
usage "rudy networks -U"
|
114
|
+
usage "rudy networks -A [-p ports] [-a addresses] [-r protocols] "
|
115
|
+
usage "rudy networks -A -p 81,8000-9000 -a 127.0.0.1,127.0.0.2"
|
116
|
+
usage "rudy networks -A -g default -o 123456789012"
|
117
|
+
usage "rudy networks -R -g default"
|
91
118
|
option :e, :external, "Display only external IP address"
|
92
119
|
option :i, :internal, "Display only internal IP address"
|
120
|
+
option :r, :protocols, Array, "List of protocols. One of: tcp (default), udp, icmp"
|
121
|
+
option :p, :ports, Array, "List of port ranges (default: 22,80,443)"
|
122
|
+
option :a, :addresses, Array, "List of IP addresses (default: your current external IP)"
|
123
|
+
option :g, :group, String, "Other group to authorize or revoke. Use with -o!"
|
124
|
+
option :o, :owner, String, "Other group owner ID (account number). Use with -g!"
|
93
125
|
action :U, :update, "Update networks based on configuration"
|
94
126
|
action :L, :local, "Show local network configuration"
|
127
|
+
action :A, :authorize, "Authorize a rule for a network security group"
|
128
|
+
action :R, :revoke, "Revoke a rule for a network security group"
|
95
129
|
command :networks => Rudy::CLI::Networks
|
96
130
|
command_alias :networks, :n
|
97
131
|
|
@@ -134,7 +168,7 @@ class RudyCLI < Rudy::CLI::Base
|
|
134
168
|
|
135
169
|
about "Display existing environment objects"
|
136
170
|
option :l, :all, "Include all regions"
|
137
|
-
command :
|
171
|
+
command :info => Rudy::CLI::Info
|
138
172
|
|
139
173
|
about "Log in to a machine"
|
140
174
|
command :ssh => Rudy::CLI::Machines
|
@@ -144,8 +178,8 @@ class RudyCLI < Rudy::CLI::Base
|
|
144
178
|
#option :p, :port, Integer, "Port"
|
145
179
|
#command :open => Rudy::CLI::Candy
|
146
180
|
|
147
|
-
usage "rudy [-f config-file] config [param-name]"
|
148
181
|
about "Check Rudy configuration."
|
182
|
+
usage "rudy [-f config-file] config [param-name]"
|
149
183
|
option :l, :all, "Display all configs for all machines"
|
150
184
|
option :commands, "Display commands configuration"
|
151
185
|
option :defaults, "Display defaults configuration"
|
@@ -163,7 +197,29 @@ class RudyCLI < Rudy::CLI::Base
|
|
163
197
|
command :print_global => Rudy::CLI::Config
|
164
198
|
command_alias :print_global, :globals
|
165
199
|
command_alias :print_global, :global
|
166
|
-
|
200
|
+
|
201
|
+
about "Create a machine image from a running instance (Windows only)"
|
202
|
+
usage "rudy -b BUCKET-NAME bundle IMAGE-NAME"
|
203
|
+
argv :name
|
204
|
+
command :bundle => Rudy::CLI::Images
|
205
|
+
|
206
|
+
about "Check status of bundling process (Windows only)"
|
207
|
+
usage "rudy -b BUCKET-NAME bundle-status IMAGE-NAME"
|
208
|
+
argv :name
|
209
|
+
command :bundle_status => Rudy::CLI::Images
|
210
|
+
|
211
|
+
about "Display machine images"
|
212
|
+
usage "rudy images"
|
213
|
+
usage "rudy images -o amazon"
|
214
|
+
usage "rudy -b BUCKET-NAME images -R IMAGE-NAME"
|
215
|
+
usage "rudy images -D AMI"
|
216
|
+
option :o, :owner, String, "Owner ID (default: self)"
|
217
|
+
action :R, :register, "Register a machine image"
|
218
|
+
action :D, :deregister, "De-register a machine image (does not delete from S3)"
|
219
|
+
argv :name
|
220
|
+
command :images => Rudy::CLI::Images
|
221
|
+
command_alias :images, :im
|
222
|
+
|
167
223
|
about "Initialize Rudy configuration"
|
168
224
|
command :init do |obj|
|
169
225
|
|
data/bin/rudy-ec2
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
machines do
|
3
|
+
env :stage do
|
4
|
+
user :jira
|
5
|
+
ami 'ami-e348af8a' # Alestic Debian 5.0, 32-bit (US)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
routines do
|
10
|
+
setup do
|
11
|
+
# NOTE: This fails b/c it's trying to login as jira rather than root.
|
12
|
+
adduser :jira
|
13
|
+
authorize :jira
|
14
|
+
end
|
15
|
+
end
|
data/examples/gem-test.rb
CHANGED
@@ -10,9 +10,11 @@ defaults do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
machines do
|
13
|
+
region :'us-east-1' do
|
14
|
+
ami 'ami-e348af8a' # Alestic Debian 5.0, 32-bit (US)
|
15
|
+
end
|
13
16
|
env :test do
|
14
17
|
role :rudy do
|
15
|
-
ami 'ami-e348af8a' # Alestic Debian 5.0, 32-bit (US)
|
16
18
|
user :root
|
17
19
|
end
|
18
20
|
end
|
@@ -22,15 +24,14 @@ commands do
|
|
22
24
|
allow :apt_get, "apt-get", :y, :q
|
23
25
|
allow :gem_install, "/usr/bin/gem", "install", :n, '/usr/bin', :y, :V, "--no-rdoc", "--no-ri"
|
24
26
|
allow :gem_sources, "/usr/bin/gem", "sources"
|
25
|
-
allow :gem_uninstall, "/usr/bin/gem", "uninstall", :V
|
27
|
+
allow :gem_uninstall, "/usr/bin/gem", "uninstall", :V
|
26
28
|
allow :update_rubygems
|
27
29
|
allow :rake
|
28
30
|
allow :rm
|
29
31
|
end
|
30
32
|
|
31
33
|
routines do
|
32
|
-
|
33
|
-
|
34
|
+
|
34
35
|
install_rubyforge do
|
35
36
|
remote :root do
|
36
37
|
gem_install 'rudy', :V
|
@@ -67,13 +68,14 @@ routines do
|
|
67
68
|
end
|
68
69
|
|
69
70
|
init_rudy do
|
71
|
+
before :install_gem
|
70
72
|
remote do
|
71
73
|
disable_safe_mode
|
72
74
|
rudy :v, :v, 'init' # create home directory
|
73
75
|
file_upload File.expand_path('~/.rudy/config'), '.rudy/'
|
74
76
|
ls :l, '.rudy/config'
|
75
77
|
rudy :v, :v, 'init'
|
76
|
-
rudy '
|
78
|
+
rudy 'info', :l
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
@@ -88,5 +90,9 @@ routines do
|
|
88
90
|
update_rubygems
|
89
91
|
end
|
90
92
|
end
|
93
|
+
|
94
|
+
startup do
|
95
|
+
after :sysupdate
|
96
|
+
end
|
91
97
|
end
|
92
98
|
|
data/examples/solaris.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Rudy Solaris Machines
|
2
|
+
#
|
3
|
+
# This configuration is used to
|
4
|
+
# test solaris instance support.
|
5
|
+
|
6
|
+
|
7
|
+
defaults do
|
8
|
+
color true
|
9
|
+
environment :test
|
10
|
+
role :solaris
|
11
|
+
end
|
12
|
+
|
13
|
+
machines do
|
14
|
+
region :'us-east-1' do
|
15
|
+
ami 'ami-8f30d1e6' # OpenSolaris 2009.06 32-bit (US)
|
16
|
+
end
|
17
|
+
region :'eu-west-1' do
|
18
|
+
ami 'ami-2381a957' # OpenSolaris 2009.06 32-bit (EU)
|
19
|
+
end
|
20
|
+
env :test do
|
21
|
+
role :solaris do
|
22
|
+
user :root
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
routines do
|
28
|
+
|
29
|
+
uname do
|
30
|
+
remote :root do
|
31
|
+
uname :a
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
data/examples/windows.rb
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
# Rudy Windows Machines
|
2
|
+
#
|
3
|
+
# This configuration is used to
|
4
|
+
# test windows instance support.
|
5
|
+
|
6
|
+
|
7
|
+
defaults do
|
8
|
+
color true
|
9
|
+
environment :test
|
10
|
+
role :windows
|
11
|
+
zone :'eu-west-1b'
|
12
|
+
bucket 'rudy-ami-eu'
|
13
|
+
end
|
14
|
+
|
15
|
+
machines do
|
16
|
+
region :'us-east-1' do
|
17
|
+
ami 'ami-de4daab7' # Amazon Windows Server 2003 (US)
|
18
|
+
size 'm1.small'
|
19
|
+
end
|
20
|
+
region :'eu-west-1' do
|
21
|
+
ami 'ami-8696bef2' # Rudy Windows 2009-08-24 (EU)
|
22
|
+
end
|
23
|
+
env :test do
|
24
|
+
role :windows do
|
25
|
+
os :windows
|
26
|
+
user :Administrator
|
27
|
+
disks do
|
28
|
+
path "F:" do
|
29
|
+
size 1
|
30
|
+
device 'xvdf'
|
31
|
+
fstype 'ntfs'
|
32
|
+
end
|
33
|
+
path "E:" do
|
34
|
+
size 2
|
35
|
+
device 'xvde'
|
36
|
+
end
|
37
|
+
path 'L:' do
|
38
|
+
size 3
|
39
|
+
device 'xvdl'
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
commands do
|
48
|
+
allow :rm
|
49
|
+
end
|
50
|
+
|
51
|
+
routines do
|
52
|
+
|
53
|
+
create_disks do
|
54
|
+
disks do
|
55
|
+
create "L:"
|
56
|
+
#create "F:"
|
57
|
+
#create "E:"
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
62
|
+
shutdown do
|
63
|
+
disks do
|
64
|
+
destroy "L:"
|
65
|
+
#destroy "F:"
|
66
|
+
#destroy "E:"
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
upload_config do
|
73
|
+
remote :root do
|
74
|
+
puts "Uploading rudy config"
|
75
|
+
home = guess_user_home
|
76
|
+
mkdir :p, "#{home}/.rudy", "#{home}/.ssh", ".ssh"
|
77
|
+
disable_safe_mode
|
78
|
+
file_upload '~/.rudy/config', "#{home}/.rudy/config"
|
79
|
+
puts "Uploading keypair"
|
80
|
+
file_upload '~/.ssh/id_rsa', '~/.ssh/key-eu-west-1b-test-windows', "#{home}/.ssh/"
|
81
|
+
file_upload '~/.ssh/id_rsa', '~/.ssh/key-eu-west-1b-test-windows', ".ssh/"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
__END__
|
89
|
+
|
90
|
+
* diskpart script example
|
91
|
+
* http://social.technet.microsoft.com/Forums/en-US/winserversetup/thread/2cfbaae1-6e33-4197-bb71-63434a34eb3c
|
92
|
+
* http://technet.microsoft.com/en-us/library/cc766465(WS.10).aspx
|
93
|
+
|
94
|
+
* format docs
|
95
|
+
* http://www.computerhope.com/formathl.htm
|
96
|
+
|
97
|
+
* Securing Remote Desktop with copSSH
|
98
|
+
* http://www.teamhackaday.com/2008/04/23/securing-windows-remote-desktop-with-copssh/
|
99
|
+
|
100
|
+
* Windows SSH
|
101
|
+
* http://www.windowsnetworking.com/articles_tutorials/install-SSH-Server-Windows-Server-2008.html
|