cap-rightscale 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.jp.rdoc +0 -0
- data/README.rdoc +212 -5
- data/VERSION +1 -1
- data/cap-rightscale.gemspec +4 -2
- metadata +6 -4
data/README.jp.rdoc
ADDED
File without changes
|
data/README.rdoc
CHANGED
@@ -1,23 +1,230 @@
|
|
1
1
|
= cap-rightscale
|
2
2
|
|
3
3
|
Capistrano extension that maps RightScale parameters to Roles
|
4
|
+
[RightScale](http://www.rightscale.com)
|
5
|
+
|
6
|
+
== Installation
|
7
|
+
|
8
|
+
Install the packages
|
9
|
+
|
10
|
+
For Debian/Ubuntu:
|
11
|
+
|
12
|
+
$ apt-get install ruby ruby-dev rubygems
|
13
|
+
|
14
|
+
For RHEL5 (probably needs the EPEL repository enabled):
|
15
|
+
|
16
|
+
$ yum install ruby ruby-devel rubygems
|
17
|
+
|
18
|
+
For MacOSX(MacPorts):
|
19
|
+
|
20
|
+
$ port install ruby rb-rubygems
|
21
|
+
|
22
|
+
|
23
|
+
Install the cap-rightscale:
|
24
|
+
|
25
|
+
$ gem install cap-rightscale
|
26
|
+
|
27
|
+
== Settings
|
28
|
+
|
29
|
+
To prepare, go info the root directory of that project and run capify:
|
30
|
+
|
31
|
+
$ cd <project_dir>
|
32
|
+
$ capify .
|
33
|
+
|
34
|
+
Configure Capfile(example deploy.rb):
|
4
35
|
|
5
36
|
# config/deploy.rb
|
6
37
|
require 'rubygems'
|
7
38
|
require 'cap-rightscale'
|
8
39
|
require 'cap-rightscale/recipes'
|
9
40
|
|
10
|
-
|
11
|
-
|
41
|
+
DEPLOYMENT_ID = 12345 # RightScale Deployment ID
|
42
|
+
SERVER_ARRAY_ID = 6789 # RightScale ServerArray ID
|
12
43
|
|
13
44
|
# set roles
|
14
45
|
nickname :web, :name_prefix => "proxy", :deployment => DEPLOYMENT_ID
|
15
46
|
server_array :app, :array_id => SERVER_ARRAY_ID
|
16
|
-
tag :dbm, :tags => "xx_db:role=master", :deployment => DEPLOYMENT_ID
|
17
|
-
tag :dbs, :tags => "xx_db:role=slave", :deployment => DEPLOYMENT_ID
|
47
|
+
tag :dbm, :tags => "xx_db:role=master", :deployment => DEPLOYMENT_ID
|
48
|
+
tag :dbs, :tags => "xx_db:role=slave", :deployment => DEPLOYMENT_ID, :no_release => true
|
49
|
+
|
50
|
+
Put RightScale API Credential file into <tt><HOME>/.rsconf/rsapiconfig.yml</tt>
|
51
|
+
|
52
|
+
# <HOME>/.rsconf/rsapiconfig.yml
|
53
|
+
username: user@example.com
|
54
|
+
password: yourpassword
|
55
|
+
account: 1
|
56
|
+
|
57
|
+
Run testing:
|
58
|
+
|
59
|
+
$ cap rs:none
|
60
|
+
|
61
|
+
|
62
|
+
For more help with Capistrano, see this: https://github.com/capistrano/capistrano/wiki
|
63
|
+
|
64
|
+
|
65
|
+
=== Roles
|
66
|
+
|
67
|
+
In order to define role, RightScale nickname and deployment mappings:
|
68
|
+
|
69
|
+
nickname :web, :name_prefix => "proxy", :deployment => 12345
|
70
|
+
# => role :web, ["proxyXXX", ... in deployment ID:12345]
|
71
|
+
|
72
|
+
ServerArray mappings:
|
73
|
+
|
74
|
+
server_array :app, :array_id => 6789, :backup => true
|
75
|
+
# => role(:app, :backup => true) { ["apXXX", ... in serverarray ID:6789] }
|
76
|
+
|
77
|
+
Machine tags and deployment mappings:
|
78
|
+
|
79
|
+
tag :dbm, :name_prefix => "db", :tags => ["xx_db:env=prod", "xx_db:role=master"], :deployment => 12345, :primary => true
|
80
|
+
# => role(:dbm, :primary => true) { ["dbXXX", ... in deployment ID:12345] }
|
81
|
+
|
82
|
+
=== RightScale API Credential
|
83
|
+
|
84
|
+
see the below site:
|
85
|
+
|
86
|
+
{Authentication}[http://support.rightscale.com/12-Guides/03-RightScale_API/RightScale_API_Examples/Authentication] - RightScale Cloud Management Support Portal
|
87
|
+
|
88
|
+
You must authenticate to use the RightScale API, Make sure to set your own login/password(used to login to RightScale dashboard) and account number(the tail end of the Dashboard URL: Settings > Account)
|
89
|
+
|
90
|
+
Put Authentication file described in RightScale API credentials into <tt><HOME>/.rsconf/rsapiconfig.yml</tt>
|
91
|
+
|
92
|
+
Or, You can define filepath:
|
93
|
+
|
94
|
+
# config/deploy.rb
|
95
|
+
set :rs_confpath, "/project/config/rs_auth.yml"
|
96
|
+
|
97
|
+
|
98
|
+
=== Caches
|
99
|
+
|
100
|
+
These functions require RightScale api calls, which are slow. On the first call, Write a cache file in the temp directory.
|
101
|
+
Default cache lifetime is 86400 seconds(1day) each role.
|
102
|
+
|
103
|
+
modified cache life time:
|
104
|
+
|
105
|
+
# config/deploy.rb
|
106
|
+
set :rs_lifetime, 86400 * 7 # 1week
|
107
|
+
|
108
|
+
|
109
|
+
This can be disabled with ENV variable: <tt>RS_CACHE=false</tt> , <tt>set :rs_lifetime 0</tt> OR <tt>rs_disable :use_rs_cache</tt> in the Capfile.
|
110
|
+
|
111
|
+
$ cap invoke COMMAND='hostname' RS_CACHE=false
|
112
|
+
|
113
|
+
# disable cache config/deploy.rb
|
114
|
+
set :rs_lifetime 0
|
115
|
+
# the other way
|
116
|
+
rs_disable :use_rs_cache
|
117
|
+
|
118
|
+
Conversely, to use cache to infinity with <tt>set :rs_lifetime -1</tt>.
|
119
|
+
|
120
|
+
# config/deploy.rb
|
121
|
+
set :rs_lifetime -1
|
122
|
+
|
123
|
+
Cache clear task(needs after modifying the Capfile):
|
124
|
+
|
125
|
+
$ cap rs:cache:clear
|
126
|
+
$ cap rs:cc
|
127
|
+
|
128
|
+
=== Server name to associate with the role
|
129
|
+
|
130
|
+
Default name is Amazon EC2 local IP address, This can be changed according to the parameter.
|
131
|
+
|
132
|
+
Use EC2 public IP address:
|
133
|
+
|
134
|
+
# config/deploy.rb
|
135
|
+
rs_enable :use_public_ip
|
136
|
+
|
137
|
+
|
138
|
+
Use RightScale nickname(use as name to resolve for host in <tt>/etc/hosts</tt> or dns record entry).
|
139
|
+
This takes priority over ip address.
|
140
|
+
Using RightScale Nickname, How to DNS hostname for ec2 instances:
|
141
|
+
* {"Developing RightScripts - RightScale Cloud Management Support Portal"}[http://support.rightscale.com/12-Guides/Dashboard_Users_Guide/Design/RightScripts/Actions/Developing_RightScripts#Document_your_RightScript_and_its_Inputs]
|
142
|
+
* {"Environment Inputs - RightScale Cloud Management Support Portal"}[http://support.rightscale.com/15-References/Lists/List_of_Environment_Inputs#RightScale_%28RS%29.3a]
|
143
|
+
* {"HowTo update DNS hostnames automatically for your Amazon EC2 instances | MDLog:/sysadmin"}[http://www.ducea.com/2009/06/01/howto-update-dns-hostnames-automatically-for-your-amazon-ec2-instances/]
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
# config/deploy.rb
|
148
|
+
rs_enable :use_nickname # RightScale nickname
|
149
|
+
set :rs_domain, "ec2.int.com" # set subdomain managed by your dns server zone(option: default ref <tt>search</tt> in <tt>/etc/resolv.conf</tt>)
|
150
|
+
|
151
|
+
# set domain each role(priority over <tt>set :rs_domain</tt>)
|
152
|
+
nickname :web, :nickname => "lb", :domain => "ec2.com"
|
153
|
+
|
154
|
+
=== Validate
|
155
|
+
|
156
|
+
Using ping and name resolv, validate host(except invalid host).
|
157
|
+
|
158
|
+
* <tt>rs_enable :validate_echo</tt>: In case you want to except hang-up instance
|
159
|
+
* <tt>rs_enable :validate_resolv</tt>: In case you want to except host can not be resolved
|
160
|
+
|
161
|
+
|
162
|
+
# config/deploy.rb
|
163
|
+
rs_enable :validate_echo, :validate_resolv
|
164
|
+
|
165
|
+
== nickname
|
166
|
+
|
167
|
+
Definition:
|
168
|
+
|
169
|
+
nickname(role, params)
|
170
|
+
|
171
|
+
=== Arguments
|
172
|
+
|
173
|
+
==== role
|
174
|
+
|
175
|
+
Capistrano role paramter(:app, :web, :db)
|
176
|
+
|
177
|
+
=== params
|
178
|
+
|
179
|
+
Example:
|
180
|
+
nickname :app, :name_prefix => "ap", :deployment => 12345, :user => "www"
|
181
|
+
nickname :db, :name_prefix => "db", :deployment => 12345, :except_tags => "xx_db:state=broken"
|
182
|
+
nickname :mem, :name_prefix => "mem", :deployment => 12345, :except_tags => ["xx_mem:state=out_of_service"]
|
183
|
+
|
184
|
+
== server_array
|
185
|
+
|
186
|
+
Definition:
|
187
|
+
|
188
|
+
server_array(role, params)
|
189
|
+
|
190
|
+
=== Arguments
|
191
|
+
|
192
|
+
==== role
|
193
|
+
|
194
|
+
Capistrano role paramter(:app, :web, :db)
|
195
|
+
|
196
|
+
=== params
|
197
|
+
|
198
|
+
Example:
|
199
|
+
server_array :app, :array_id => 6789, :user => "www"
|
200
|
+
server_array :mem, :array_id => 4321, :except_tags => "xx_mem:state=broken", :domain => "ec2.int.com"
|
201
|
+
|
202
|
+
== tag
|
203
|
+
|
204
|
+
Definition:
|
205
|
+
|
206
|
+
tag(role, params)
|
207
|
+
|
208
|
+
=== role
|
209
|
+
|
210
|
+
Capistrano role paramter(:app, :web, :db)
|
211
|
+
|
212
|
+
=== params
|
213
|
+
|
214
|
+
Example:
|
215
|
+
tag :dbm, :deployment => 12345, :name_prefix => "db", :tags => "xx_db:role=master", :primary => true
|
216
|
+
tag :dbs, :deployment => 12345, :tags => ["xx_db:role=slave", "xx_db:master"] # matching tag "xx_db:master=<master_ip>"
|
217
|
+
|
218
|
+
== Output message
|
219
|
+
|
220
|
+
To suppress output as possible(-v option):
|
221
|
+
|
222
|
+
$ cap -v shell
|
223
|
+
$ cap -v invoke COMMAND='cat /var/log/httpd/access_log' 2>/tmp/collect_httpd_access_log
|
224
|
+
|
18
225
|
|
19
226
|
== Contributing to cap-rightscale
|
20
|
-
|
227
|
+
|
21
228
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
22
229
|
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
23
230
|
* Fork the project
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
data/cap-rightscale.gemspec
CHANGED
@@ -5,15 +5,16 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cap-rightscale}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Satoshi Ohki"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-07}
|
13
13
|
s.description = %q{Capistrano extension that maps RightScale parameters to Roles.}
|
14
14
|
s.email = %q{roothybrid7@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE.txt",
|
17
|
+
"README.jp.rdoc",
|
17
18
|
"README.rdoc"
|
18
19
|
]
|
19
20
|
s.files = [
|
@@ -22,6 +23,7 @@ Gem::Specification.new do |s|
|
|
22
23
|
"Gemfile",
|
23
24
|
"Gemfile.lock",
|
24
25
|
"LICENSE.txt",
|
26
|
+
"README.jp.rdoc",
|
25
27
|
"README.rdoc",
|
26
28
|
"Rakefile",
|
27
29
|
"VERSION",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cap-rightscale
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 1
|
10
|
+
version: 0.6.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Satoshi Ohki
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-07 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -133,6 +133,7 @@ extensions: []
|
|
133
133
|
|
134
134
|
extra_rdoc_files:
|
135
135
|
- LICENSE.txt
|
136
|
+
- README.jp.rdoc
|
136
137
|
- README.rdoc
|
137
138
|
files:
|
138
139
|
- .document
|
@@ -140,6 +141,7 @@ files:
|
|
140
141
|
- Gemfile
|
141
142
|
- Gemfile.lock
|
142
143
|
- LICENSE.txt
|
144
|
+
- README.jp.rdoc
|
143
145
|
- README.rdoc
|
144
146
|
- Rakefile
|
145
147
|
- VERSION
|