le1t0-deprec 2.1.6.001 → 2.1.6.002

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,9 @@
1
1
  # deprec changelog
2
2
 
3
+ = 2.1.6.002 (May 20, 2010)
4
+
5
+ * add local license acceptance for java
6
+
3
7
  = 2.1.6.001 (May 19, 2010)
4
8
 
5
9
  * add 3ware-raid
@@ -1,15 +1,58 @@
1
+ def accept_license
2
+ return if java_dlj_11_license_accepted
3
+ in_license = false
4
+ Capistrano::CLI.ui.say(IO.readlines(__FILE__).collect do |line|
5
+ in_license = false if line =~ /^# END_LICENSE/
6
+ current_line = in_license ? line.strip.gsub(/^#[ ]?/, '') : nil
7
+ in_license = true if line =~ /^# START_LICENSE/
8
+ current_line
9
+ end.compact.join("\n"))
10
+ prompt = "Accept license (YES, [NO])? "
11
+ answer = Capistrano::CLI.ui.ask(prompt) do |q|
12
+ q.overwrite = false
13
+ q.default = 'NO'
14
+ q.validate = /(yes)|(no)|\n/i
15
+ q.responses[:not_valid] = prompt
16
+ end
17
+ if answer.upcase == 'YES'
18
+ set :java_dlj_11_license_accepted, true
19
+ end
20
+ end
21
+
1
22
  # Copyright 2010 by le1t0@github. All rights reserved.
2
23
  Capistrano::Configuration.instance(:must_exist).load do
3
24
  namespace :deprec do
4
25
  namespace :java do
5
26
 
6
27
  set :java_include_jdk, false
28
+ set :java_dlj_11_license_accepted, false
29
+ set :java_stopthread, true # no idea what this does, but it defaults to true on Hardy and should be preset for auto inst
7
30
 
8
31
  desc "Install Java"
9
32
  task :install do
10
- packages = %w(sun-java6-bin sun-java6-jre)
11
- packages << "sun-java6-jdk" if java_include_jdk
12
- apt.install( {:base => packages}, :stable )
33
+ accept_license
34
+ if java_dlj_11_license_accepted
35
+ debconf_set_selections_file = "/tmp/java_debconf_set_selections.#{Time.now.strftime("%Y%m%d%H%M%S")}"
36
+ debconf_set_selections = [
37
+ "sun-java6-jre sun-java6-jre/stopthread boolean #{java_stopthread}",
38
+ "sun-java6-jre sun-java6-jre/jcepolicy note",
39
+ "sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean #{java_dlj_11_license_accepted}",
40
+ "sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean #{java_dlj_11_license_accepted}",
41
+ "sun-java6-bin shared/present-sun-dlj-v1-1 note",
42
+ "sun-java6-jre shared/present-sun-dlj-v1-1 note"
43
+ ]
44
+ packages = %w(sun-java6-bin sun-java6-jre)
45
+ if java_include_jdk
46
+ packages << "sun-java6-jdk"
47
+ debconf_set_selections += [
48
+ "sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean #{java_dlj_11_license_accepted}",
49
+ "sun-java6-jdk shared/present-sun-dlj-v1-1 note"
50
+ ]
51
+ end
52
+ put debconf_set_selections.join("\n"), debconf_set_selections_file, :mode => 0644
53
+ sudo "debconf-set-selections #{debconf_set_selections_file} ; rm -f #{debconf_set_selections_file}"
54
+ apt.install( {:base => packages}, :stable )
55
+ end
13
56
  end
14
57
 
15
58
  desc "Config java"
@@ -20,4 +63,209 @@ Capistrano::Configuration.instance(:must_exist).load do
20
63
 
21
64
  end
22
65
  end
23
- end
66
+ end
67
+
68
+ # leave this license in! it is shown to the user during installation
69
+ #
70
+ # START_LICENSE
71
+ #
72
+ # Operating System Distributor License for Java version 1.1
73
+ #
74
+ # SUN MICROSYSTEMS, INC. ("SUN") IS WILLING TO LICENSE THE JAVA PLATFORM
75
+ # STANDARD EDITION DEVELOPER KIT ("JDK" - THE "SOFTWARE") TO YOU ONLY
76
+ # UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS
77
+ # LICENSE AGREEMENT (THE "AGREEMENT"). PLEASE READ THE AGREEMENT
78
+ # CAREFULLY. BY INSTALLING, USING, OR DISTRIBUTING THIS SOFTWARE, YOU
79
+ # ACCEPT ALL OF THE TERMS OF THE AGREEMENT.
80
+ #
81
+ # 1. DEFINITIONS. "Software" means the code identified above in binary
82
+ # form, any other machine readable materials including, but not
83
+ # limited to, libraries, source files, header files, and data files),
84
+ # any updates or error corrections provided by Sun, and any user
85
+ # manuals, programming guides and other documentation provided to you
86
+ # by Sun under this Agreement, and any subsequent versions that Sun
87
+ # makes available to you hereunder. "Operating System" means any
88
+ # version of the Linux or OpenSolaris operating systems that manages
89
+ # the hardware resources of a general purpose desktop or server
90
+ # computer and shares these resources with various software programs
91
+ # that run on top of it. "Programs" means Java technology applets and
92
+ # applications intended to run on the Java Platform Standard Edition
93
+ # (Java SE platform) platform on Java-enabled general purpose desktop
94
+ # computers and servers.
95
+ #
96
+ # 2. License Grant. Subject to the terms and conditions of this
97
+ # Agreement, as well as the restrictions and exceptions set forth in
98
+ # the Software README file, Sun grants you a non-exclusive,
99
+ # non-transferable, royalty-free limited license to reproduce and use
100
+ # the Software internally, complete and unmodified, for the sole
101
+ # purposes of running Programs and designing, developing and testing
102
+ # Programs. Sun also grants you a non-exclusive, non-transferable,
103
+ # royalty-free limited license to reproduce and distribute the
104
+ # Software, directly or indirectly through your licensees,
105
+ # distributors, resellers, or OEMs, electronically or in physical
106
+ # form or pre-installed with your Operating System on a general
107
+ # purpose desktop computer or server, provided that: (a) the Software
108
+ # and any proprietary legends or notices are complete and unmodified;
109
+ # (b) the Software is distributed with your Operating System, and
110
+ # such distribution is solely for the purposes of running Programs
111
+ # under the control of your Operating System and designing,
112
+ # developing and testing Programs to be run under the control of your
113
+ # Operating System; (c) you do not combine, configure or distribute
114
+ # the Software to run in conjunction with any additional software
115
+ # that implements the same or similar functionality or APIs as the
116
+ # Software; (d) you do not remove or modify any included license
117
+ # agreement or impede or prevent it from displaying and requiring
118
+ # acceptance; (e) you only distribute the Software subject to this
119
+ # license agreement; and (f) you agree to defend and indemnify Sun
120
+ # and its licensors from and against any damages, costs, liabilities,
121
+ # settlement amounts and/or expenses (including attorneys' fees)
122
+ # incurred in connection with any claim, lawsuit or action by any
123
+ # third party that arises or results from (i) the use or distribution
124
+ # of your Operating System, or any part thereof, in any manner, or
125
+ # (ii) your use or distribution of the Software in violation of the
126
+ # terms of this Agreement or applicable law. You shall not be
127
+ # obligated under Section 2(f)(i) if such claim would not have
128
+ # occurred but for a modification made to your Operating System by
129
+ # someone not under your direction or control, and you were in
130
+ # compliance with all other terms of this Agreement. If the Software
131
+ # README file permits certain files to be replaced or omitted from
132
+ # your distribution, then any such replacement(s) or omission(s)
133
+ # shall not be considered a breach of Section 2(a).
134
+ #
135
+ # 3. RESTRICTIONS. Software is copyrighted and title to Software and
136
+ # all associated intellectual property rights is retained by Sun
137
+ # and/or its licensors. Unless enforcement is prohibited by
138
+ # applicable law, you may not modify, decompile, or reverse engineer
139
+ # Software. You may not create, modify, or change the behavior of,
140
+ # or authorize your licensees, distributors, resellers, OEMs, or end
141
+ # users (collectively, "Licensees") to create, modify, or change the
142
+ # behavior of, classes, interfaces, or subpackages that are in any
143
+ # way identified as "java", "javax", "sun" or similar convention as
144
+ # specified by Sun in any naming convention designation. You
145
+ # acknowledge that Licensed Software is not designed or intended for
146
+ # use in the design, construction, operation or maintenance of any
147
+ # nuclear facility. Sun Microsystems, Inc. disclaims any express or
148
+ # implied warranty of fitness for such uses.
149
+ #
150
+ # 4. COMPATIBILITY. If you exercise the license in Section 2, and Sun
151
+ # or a licensee of the Software (under section 4(b)) notifies you
152
+ # that there are compatibility issues (as determined by the
153
+ # applicable Technology Compatibility Kit) caused by the interaction
154
+ # of the Software with your Operating System, then within ninety
155
+ # (90) days you must either: (a) modify the Operating System in a
156
+ # way that resolves the compatibility issue (as determined by Sun)
157
+ # and make a patch or replacement version available to your
158
+ # Licensees who have already received the version of your Operating
159
+ # System that was the subject of the compatibility issue ("Your
160
+ # Incompatible Operating System"); or (b) cease distributing the
161
+ # Software and make commercially reasonable attempts to forward the
162
+ # notification to your Licensees who have already received Your
163
+ # Incompatible Operating System.
164
+ #
165
+ # 5. Trademarks and Logos. No right, title or interest in or to any
166
+ # trademark, service mark, logo or trade name of Sun or its
167
+ # licensors is granted under this Agreement. You acknowledge and
168
+ # agree that, as between you and Sun, Sun owns the SUN and JAVA
169
+ # trademarks and all SUN and JAVA-related trademarks, service marks,
170
+ # logos and other brand designations ("Sun Marks"), and you agree to
171
+ # comply with the Sun Trademark and Logo Usage Requirements
172
+ # currently located at http://www.sun.com/policies/trademarks. Any
173
+ # use you make of the Sun Marks inures to Sun's benefit.
174
+ #
175
+ # 6. LIMITED WARRANTY. If you received the Software directly from Sun
176
+ # or its authorized resellers, Sun warrants to you that for a period
177
+ # of ninety (90) days from delivery to you, the media on which
178
+ # Software is furnished (if any) will be free of defects in
179
+ # materials and workmanship under normal use. Except for the
180
+ # foregoing, Software is provided "AS IS". Your exclusive remedy
181
+ # and Sun's entire liability under this limited warranty will be
182
+ # replacement of the Software media. This limited warranty gives
183
+ # you specific legal rights. You may have others, which vary from
184
+ # state to state.
185
+ #
186
+ # 7. DISCLAIMER OF WARRANTY. UNLESS SPECIFIED IN THIS AGREEMENT, ALL
187
+ # EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
188
+ # INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
189
+ # PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO
190
+ # THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
191
+ #
192
+ # 8. LIMITATION OF LIABILITY. IN NO EVENT WILL SUN OR ITS LICENSORS BE
193
+ # LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR
194
+ # PUNITIVE DAMAGES IN CONNECTION WITH OR ARISING OUT OF THIS
195
+ # AGREEMENT (INCLUDING LOSS OF PROFITS, USE, DATA, OR OTHER ECONOMIC
196
+ # ADVANTAGE), NO MATTER WHAT THEORY OF LIABILITY, EVEN IF SUN HAS
197
+ # BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will
198
+ # Sun's liability to you, whether in contract, tort (including
199
+ # negligence), or otherwise, exceed the amount paid by you for the
200
+ # Software under this Agreement. The foregoing limitations will
201
+ # apply even if the above stated warranty fails of its essential
202
+ # purpose. Some states do not allow the exclusion of incidental or
203
+ # consequential damages, so some of the terms above may not be
204
+ # applicable to you.
205
+ #
206
+ # 9. THIRD PARTY CODE. Additional copyright notices and license terms
207
+ # applicable to portions of the Software are set forth in the
208
+ # THIRDPARTYLICENSEREADME.txt file. In addition to any terms and
209
+ # conditions of any third party opensource/freeware license
210
+ # identified in the THIRDPARTYLICENSEREADME.txt file, the disclaimer
211
+ # of warranty and limitation of liability provisions in paragraphs 7
212
+ # and 8 of this Agreement shall apply to all Software in this
213
+ # distribution.
214
+ #
215
+ # 10. Termination. This Agreement is effective until it is
216
+ # terminated. You may terminate this Agreement at any time by
217
+ # ceasing distribution of the Software. This Agreement will
218
+ # terminate immediately without notice from Sun if you fail to
219
+ # comply with any material provision herein. Either party may
220
+ # terminate this Agreement immediately should any Software become,
221
+ # or in either party's opinion be likely to become, the subject of a
222
+ # claim of infringement of any intellectual property right. Upon
223
+ # termination, you must destroy all copies and cease copying and
224
+ # distribution of the Software. All of your obligations and any
225
+ # applicable limitations on your rights and remedies under this
226
+ # Agreement shall survive termination.
227
+ #
228
+ # 11. SOURCE CODE. Software may contain source code that, unless
229
+ # expressly licensed for other purposes, is provided solely for
230
+ # reference purposes pursuant to the terms of this Agreement.
231
+ # Source code may not be redistributed unless expressly provided for
232
+ # in this Agreement.
233
+ #
234
+ # 12. Export Regulations. All Software and technical data delivered
235
+ # under this Agreement are subject to US export control laws and may
236
+ # be subject to export or import regulations in other countries.
237
+ # You acknowledge that you have the responsibility to obtain such
238
+ # licenses to export, re-export, or import as may be required after
239
+ # delivery to you.
240
+ #
241
+ # 13. U.S. GOVERNMENT RESTRICTED RIGHTS. If Software is being acquired
242
+ # by or on behalf of the U.S. Government or by a U.S. Government
243
+ # prime contractor or subcontractor (at any tier), then the
244
+ # Government's rights in Software and accompanying documentation
245
+ # will be only as set forth in this Agreement; this is in accordance
246
+ # with 48 CFR 227.7201 through 227.7202-4 (for Department of Defense
247
+ # (DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD
248
+ # acquisitions).
249
+ #
250
+ # 14. MISCELLANEOUS. Any action related to this Agreement will be
251
+ # governed by California law and controlling U.S. federal law. No
252
+ # choice of law rules of any jurisdiction will apply. If any
253
+ # provision of this Agreement is held to be unenforceable, this
254
+ # Agreement will remain in effect upon the parties' agreement to
255
+ # revised terms that most nearly accomplish the same effect. This
256
+ # Agreement is the entire agreement between you and Sun relating to
257
+ # its subject matter. It supersedes all prior or contemporaneous
258
+ # oral or written communications, proposals, representations and
259
+ # warranties and prevails over any conflicting or additional terms
260
+ # of any quote, order, acknowledgment, or other communication
261
+ # between the parties relating to its subject matter during the term
262
+ # of this Agreement. No modification of this Agreement will be
263
+ # binding, unless in writing and signed by an authorized
264
+ # representative of each party.
265
+ #
266
+ # For inquiries please contact: Sun Microsystems, Inc., 4150 Network Circle,
267
+ # Santa Clara, California 95054, U.S.A.
268
+ #
269
+ # DLJ v1.1 27APR2006ANS
270
+ #
271
+ # END_LICENSE
@@ -13,17 +13,37 @@ Capistrano::Configuration.instance(:must_exist).load do
13
13
 
14
14
  # define images to create, i.e.:
15
15
  # set :xen_images, [
16
- # {
17
- # :lvm => 'mylvm',
18
- # :gateway => '10.0.0.1',
19
- # :netmask => '255.255.0.0',
20
- # :size => '15Gb',
21
- # :memory => '1Gb',
22
- # :swap => '2Gb',
23
- # :hostname => 'rails1',
24
- # :ip => '10.0.2.1',
25
- # :mac => '00:16:3e:00:00:01'
26
- # } ]
16
+ # {
17
+ # :hostname => 'appserver',
18
+ # :lvm => 'mylvm',
19
+ # :gateway => '10.0.0.1',
20
+ # :netmask => '255.255.0.0',
21
+ # :size => '15Gb',
22
+ # :memory => '1Gb',
23
+ # :swap => '2Gb',
24
+ # :ip => '10.0.2.1',
25
+ # :mac => '00:16:3e:00:00:01',
26
+ # :vcups => 3, # specify amount of vcpus to use, this will be put in the VM config in /etc/xen/
27
+ # :cpus => '1,3,6', # specify list of cpus to use, this will be put in the VM config in /etc/xen/
28
+ # :arch => 'i386' # specify to create an i386 VM if you have a x86_64 host for example; optional.
29
+ # },
30
+ # {
31
+ # :hostname => 'db',
32
+ # :lvm => 'mylvm',
33
+ # :gateway => '10.0.0.1',
34
+ # :netmask => '255.255.0.0',
35
+ # :size => '15Gb',
36
+ # :memory => '1Gb',
37
+ # :swap => '2Gb',
38
+ # :ip => '10.0.2.1',
39
+ # :mac => '00:16:3e:00:00:01',
40
+ # :vcups => 3, # specify amount of vcpus to use, this will be put in the VM config in /etc/xen/
41
+ # :cpus => '1,3,6', # specify list of cpus to use, this will be put in the VM config in /etc/xen/
42
+ # }
43
+ # ]
44
+ # Options in the hash above will be sent as is to the xen-create-image command, any options that xen-create-image
45
+ # accepts you can add there. Additionally the options :vcpus and :cpus are accepted, which are stripped out before
46
+ # calling xen-create-image, and put into the resulting xen VM configuration file.
27
47
  set :xen_images, []
28
48
 
29
49
  set :xen_volume_group_name, 'xendisks'
@@ -223,6 +243,12 @@ Capistrano::Configuration.instance(:must_exist).load do
223
243
  sudo "touch /etc/init.d/hwclock.sh"
224
244
  end
225
245
 
246
+ # create new xen images, based on configuration in :xen_images capistrano variable (see above)
247
+ # a subselection of images can be created by using the ONLY=".." environment variable:
248
+ #
249
+ # $ cap deprec:xen:create_images ONLY="appserver"
250
+ #
251
+ # The images to create are matched on the :hostname value in :xen_images
226
252
  desc "Create Xen images"
227
253
  task :create_images, :roles => :dom0 do
228
254
  handle_xen_images do |xen_image|
@@ -240,6 +266,7 @@ Capistrano::Configuration.instance(:must_exist).load do
240
266
  top.deprec.xen.auto_start_images
241
267
  end
242
268
 
269
+ # Same explanation as for create_images, but in this case for registering images to be auto-started at host sys boot up
243
270
  desc "Make links for xen image configs to be started automatically"
244
271
  task :auto_start_images, :roles => :dom0 do
245
272
  handle_xen_images do |xen_image|
@@ -248,6 +275,7 @@ Capistrano::Configuration.instance(:must_exist).load do
248
275
  end
249
276
  end
250
277
 
278
+ # Same explanation as for create_images, but in this case for unregistering images to be auto-started at host sys boot up
251
279
  desc "Make links for xen image configs to be started automatically"
252
280
  task :undo_auto_start_images, :roles => :dom0 do
253
281
  handle_xen_images do |xen_image|
@@ -256,6 +284,7 @@ Capistrano::Configuration.instance(:must_exist).load do
256
284
  end
257
285
  end
258
286
 
287
+ # Same explanation as for create_images, but in this case for starting images
259
288
  desc "Start Xen images"
260
289
  task :start_images, :roles => :dom0 do
261
290
  handle_xen_images do |xen_image|
@@ -264,6 +293,7 @@ Capistrano::Configuration.instance(:must_exist).load do
264
293
  end
265
294
  end
266
295
 
296
+ # show configs of all registered VMs on host system, use grep to get certain info fields
267
297
  desc "Show configs of all installed VMs"
268
298
  task :show_vm_configs do
269
299
  all_data = ""
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 2
7
7
  - 1
8
8
  - 6
9
- - 1
10
- version: 2.1.6.001
9
+ - 2
10
+ version: 2.1.6.002
11
11
  platform: ruby
12
12
  authors:
13
13
  - Le1t0
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-19 00:00:00 +02:00
18
+ date: 2010-05-20 00:00:00 +02:00
19
19
  default_executable: depify
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency