rudy 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +32 -17
- data/README.rdoc +74 -40
- 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 +41 -36
- 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 +171 -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 +17 -10
- 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 +14 -7
- data/lib/rudy/cli/status.rb +0 -60
data/CHANGES.txt
CHANGED
@@ -1,6 +1,37 @@
|
|
1
1
|
RUDY, CHANGES
|
2
2
|
|
3
3
|
|
4
|
+
#### 0.9.2 (2009-08-25) ###########################
|
5
|
+
|
6
|
+
* FIXED: Threading error in Net::HTTP by forcing a mutex during AWS::EC2 requests
|
7
|
+
* FIXED: errors when washing backups
|
8
|
+
* FIXED: Host.is_available? now checks port 3389 (Remote Desktop) for Windows instances. Closes GH-16
|
9
|
+
* FIXED: "rudy machines -T" now checks port 3389 for Windows instances. Closes GH-21
|
10
|
+
* FIXED: "rudy disks -l" doesn't display disks from a different zone. Closes GH-24
|
11
|
+
* FIXED: Rudy::Machine#refresh! now correctly refreshes metadata
|
12
|
+
* FIXED: startup, shutdown, and reboot routines don't run correctly as dependencies. Closes GH-25
|
13
|
+
* FIXED: Rogue "No machines configuration" error when accessing current_machine_address
|
14
|
+
* CHANGE: Increased AWS timeout to 30 seconds. Closes GH-19
|
15
|
+
* CHANGE: Increased boot wait time for windows instances to 500 seconds.
|
16
|
+
* CHANGE: Module names have changed from EC2 to AWS::EC2 in amazon-ec2 0.5 [Dominic Cleal]
|
17
|
+
* CHANGE: Rudy::Routines::Handlers::Disks.attach now creates a volume if the disk doesn't already have one.
|
18
|
+
* CHANGE: Standardized CLI outut for rudy-ec2 (except groups b/c of weird YAML error)
|
19
|
+
* CHANGE: Windows "os" is now referred to by :windows rather than :win32 (SysInfo 0.7)
|
20
|
+
* CHANGE: Renamed "rudy status" to "rudy info"
|
21
|
+
* ADDED: Rudy::Machine#get_console, Rudy::Machine#get_password
|
22
|
+
* ADDED: Rudy::Machine#windows?, Rudy::Machine#linux?, Rudy::Machine#solaris?, Rudy::Machine#os?
|
23
|
+
* ADDED: "rudy m -console" and "rudy m --password"
|
24
|
+
* ADDED: "rudy keypairs"
|
25
|
+
* ADDED: "rudy networks --authorize"
|
26
|
+
* ADDED: "rudy networks --revoke"
|
27
|
+
* ADDED: "rudy disks --create"
|
28
|
+
* ADDED: "rudy disks --destroy"
|
29
|
+
* ADDED: "rudy backups --create"
|
30
|
+
* ADDED: Support for attaching and formating disks in Windows.
|
31
|
+
* ADDED: "rudy-ec2 info"
|
32
|
+
* ADDED: Re-enabled networks action to routines config (see examples/jira.rb)
|
33
|
+
|
34
|
+
|
4
35
|
#### 0.9.1 (2009-08-05) ###########################
|
5
36
|
|
6
37
|
* FIXED: "rudy init" now exits with 0
|
@@ -95,7 +126,7 @@ NOTE: This is a significant re-write from 0.8 (primarily the routines, metadata)
|
|
95
126
|
|
96
127
|
#### 0.8.5 (2009-06-08) ###############################
|
97
128
|
|
98
|
-
* FIXED: Bug in
|
129
|
+
* FIXED: Bug in DiskHandler. mount method tried to attach when already attached.
|
99
130
|
* CHANGE: rudy config now displays account info (but keeps secret key hidden)
|
100
131
|
* CHANGE: defaults configuration has been removed from the default ~/.rudy/config.
|
101
132
|
It is now recommended to put it in the same place as machines, routines config.
|
@@ -326,20 +357,4 @@ NOTE: This is a complete re-write from 0.1
|
|
326
357
|
* Initial public release
|
327
358
|
|
328
359
|
|
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
|
-
|
344
|
-
|
345
360
|
|
data/README.rdoc
CHANGED
@@ -1,63 +1,89 @@
|
|
1
|
-
= Rudy - v0.9
|
1
|
+
= Rudy - v0.9 BETA
|
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
|
-
All configuration is organized into
|
8
|
-
|
9
|
-
<b>See Getting-Started[http://solutious.com/projects/rudy/getting-started/] for more info.</b>
|
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.
|
10
8
|
|
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>).
|
11
10
|
|
12
|
-
|
11
|
+
<b>Get-Started[http://solutious.com/projects/rudy/getting-started/] with Rudy now.</b>
|
13
12
|
|
14
|
-
<em>This is a BETA release. That means Rudy's not ready for production use! See Project-Status[http://wiki.github.com/solutious/rudy/project-status].</em>
|
15
13
|
|
16
|
-
|
14
|
+
== Configuration
|
17
15
|
|
16
|
+
Rudy is configured via several Ruby-based domain specific languages.
|
18
17
|
|
19
|
-
== Configuration
|
20
18
|
|
21
19
|
=== Machines
|
22
20
|
|
23
21
|
The machines configuration describes the "physical" characteristics of your infrastructure.
|
24
22
|
|
25
|
-
|
26
|
-
|
23
|
+
machines do
|
24
|
+
env :stage do # Define an environment
|
25
|
+
ami 'ami-e348af8a' # Specify a machine image
|
26
|
+
|
27
|
+
role :app do # Define a role
|
28
|
+
addresses '11.22.33.44' # Use elastic IPs
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
device "/dev/sdr"
|
35
|
-
end
|
30
|
+
disks do # Define EBS volumes
|
31
|
+
path "/rudy/disk1" do
|
32
|
+
size 100
|
33
|
+
device "/dev/sdr"
|
34
|
+
end
|
35
|
+
end
|
36
36
|
end
|
37
|
+
|
37
38
|
end
|
38
39
|
end
|
39
|
-
|
40
|
+
|
40
41
|
=== Routines
|
41
42
|
|
42
43
|
The routines configuration describes repeatable processes that you can execute on your machines.
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
|
45
|
+
routines do
|
46
|
+
|
47
|
+
startup do # $ rudy startup
|
48
|
+
adduser :rudy
|
49
|
+
authorize :rudy # Enable passwordless login
|
47
50
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
+
disks do
|
52
|
+
create "/rudy/disk1" # Create, format, and mount a volume
|
53
|
+
end
|
51
54
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
55
|
+
remote :rudy do # Run remote commands via SSH
|
56
|
+
mkdir :p, "great" # $ mkdir -p great
|
57
|
+
mysql_init :start
|
58
|
+
your_script 'arg1', 'arg2' # Call your own scripts
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
57
62
|
end
|
63
|
+
|
64
|
+
See Rudyfile[http://github.com/solutious/rudy/raw/master/Rudyfile] for a complete configuration example.
|
58
65
|
|
59
66
|
|
67
|
+
== Running Commands
|
60
68
|
|
69
|
+
Rudy comes with a command-line tool called <tt>rudy</tt>. It provides commands for describing the infrastructures you've built with Rudy.
|
70
|
+
|
71
|
+
$ rudy machines
|
72
|
+
m-us-east-1d-stage-app-01: ec2-67-202-0-112.compute-1.amazonaws.com
|
73
|
+
m-us-east-1d-stage-app-02: ec2-174-129-117-30.compute-1.amazonaws.com
|
74
|
+
|
75
|
+
$ rudy disks
|
76
|
+
disk-us-east-1d-stage-app-01-rudy-disk1
|
77
|
+
disk-us-east-1d-stage-app-02-rudy-disk1
|
78
|
+
|
79
|
+
$ rudy backups
|
80
|
+
back-us-east-1d-stage-app-01-rudy-disk1-20090803-1857-49
|
81
|
+
back-us-east-1d-stage-app-01-rudy-disk1-20090803-1858-36
|
82
|
+
back-us-east-1d-stage-app-02-rudy-disk1-20090803-1911-05
|
83
|
+
|
84
|
+
See <tt>rudy -h</tt> for more info.
|
85
|
+
|
86
|
+
|
61
87
|
== Features
|
62
88
|
|
63
89
|
* Create complex IT infrastructures from a simple configuration
|
@@ -69,9 +95,15 @@ The routines configuration describes repeatable processes that you can execute o
|
|
69
95
|
* Powerful command-line tools
|
70
96
|
* <tt>$ rudy -u root ssh</tt>
|
71
97
|
* <tt>$ rudy -e testing -r database backup-mysql</tt>
|
72
|
-
* Use _any Linux_ Amazon machine image (AMI) (partial Solaris support)
|
98
|
+
* Use _any Linux_ Amazon machine image (AMI) (partial Windows and Solaris support)
|
73
99
|
* Complete command-line interface for EC2. See <tt>bin/rudy-ec2</tt>.
|
74
100
|
|
101
|
+
|
102
|
+
== Project Status
|
103
|
+
|
104
|
+
<em>This is a BETA release. That means Rudy is not ready for production use! See Project-Status[http://wiki.github.com/solutious/rudy/project-status].</em>
|
105
|
+
|
106
|
+
|
75
107
|
== Installation
|
76
108
|
|
77
109
|
Via Rubygems:
|
@@ -113,6 +145,7 @@ NOTE: <em>If you are not installing via RubyGems, you need to make sure the depe
|
|
113
145
|
* Linux: Ruby 1.8, 1.9, and JRuby 1.3+
|
114
146
|
* Windows: Ruby 1.8 and JRuby 1.3+ (Net::SSH does not run under Ruby 1.9)
|
115
147
|
* BSD: <i>Needs testing (any takers?)</i>
|
148
|
+
|
116
149
|
|
117
150
|
== More Info
|
118
151
|
|
@@ -124,6 +157,14 @@ NOTE: <em>If you are not installing via RubyGems, you need to make sure the depe
|
|
124
157
|
* For all other inquires, email me directly: delano (@solutious.com)
|
125
158
|
|
126
159
|
|
160
|
+
== Contributions
|
161
|
+
|
162
|
+
We encourage people to find unique and interesting ways to break and extend rudy.
|
163
|
+
|
164
|
+
* For bigger features please fork the git repo and send me a pull request.
|
165
|
+
* For small or single file changes, send an email with details to: delano (@solutious.com)
|
166
|
+
|
167
|
+
|
127
168
|
== Thanks
|
128
169
|
|
129
170
|
* Kalin Harvey for all the feedback
|
@@ -141,16 +182,9 @@ NOTE: <em>If you are not installing via RubyGems, you need to make sure the depe
|
|
141
182
|
* Marcel Molina Jr. for aws-s3
|
142
183
|
* Keshia Knight Pulliam
|
143
184
|
|
144
|
-
|
145
|
-
== Contributions
|
146
|
-
|
147
|
-
* For bigger features please fork the git repo and send me a pull request.
|
148
|
-
* For small or single file changes, send me an email with the details: Delano (@solutious.com)
|
149
|
-
|
150
|
-
|
151
185
|
== Credits
|
152
186
|
|
153
|
-
* Delano Mandelbaum (
|
187
|
+
* Delano Mandelbaum ( http://solutious.com/ )
|
154
188
|
* Rudy::AWS::SDB adapted from aws_sdb by Tim Dysinger (http://dysinger.net)
|
155
189
|
|
156
190
|
|
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
|
|