veewee 0.3.0.beta1 → 0.3.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. data/README.md +7 -7
  2. data/Rakefile +29 -10
  3. data/bin/veewee +5 -0
  4. data/doc/vagrant.md +2 -2
  5. data/lib/veewee/command/fusion.rb +1 -0
  6. data/lib/veewee/command/kvm.rb +1 -0
  7. data/lib/veewee/command/parallels.rb +1 -0
  8. data/lib/veewee/command/vagrant/validate.rb +5 -3
  9. data/lib/veewee/command/vbox.rb +1 -0
  10. data/lib/veewee/config/ostypes.yml +36 -2
  11. data/lib/veewee/definition.rb +2 -2
  12. data/lib/veewee/environment.rb +3 -1
  13. data/lib/veewee/provider/core/box.rb +2 -0
  14. data/lib/veewee/provider/core/box/build.rb +2 -2
  15. data/lib/veewee/provider/core/box/scp.rb +1 -1
  16. data/lib/veewee/provider/core/box/validate_tags.rb +58 -0
  17. data/lib/veewee/provider/core/provider.rb +5 -0
  18. data/lib/veewee/provider/kvm/box/create.rb +2 -2
  19. data/lib/veewee/provider/kvm/box/helper/console_type.rb +3 -3
  20. data/lib/veewee/provider/kvm/box/helper/ip.rb +2 -2
  21. data/lib/veewee/provider/kvm/box/helper/status.rb +2 -2
  22. data/lib/veewee/provider/kvm/box/validate_kvm.rb +1 -33
  23. data/lib/veewee/provider/kvm/provider.rb +1 -1
  24. data/lib/veewee/provider/parallels/box/validate_parallels.rb +1 -35
  25. data/lib/veewee/provider/virtualbox/box/helper/create.rb +3 -3
  26. data/lib/veewee/provider/virtualbox/box/validate_vagrant.rb +2 -42
  27. data/lib/veewee/provider/vmfusion/box/helper/buildinfo.rb +7 -3
  28. data/lib/veewee/provider/vmfusion/box/template.rb +9 -0
  29. data/lib/veewee/provider/vmfusion/box/template.vmx.erb +1 -1
  30. data/lib/veewee/provider/vmfusion/box/validate_vmfusion.rb +1 -35
  31. data/lib/veewee/provider/vmfusion/provider.rb +14 -10
  32. data/lib/veewee/version.rb +1 -1
  33. data/templates/CentOS-6.0-i386-netboot/base.sh +14 -0
  34. data/templates/CentOS-6.0-i386-netboot/chef.sh +3 -0
  35. data/templates/CentOS-6.0-i386-netboot/cleanup.sh +5 -0
  36. data/templates/CentOS-6.0-i386-netboot/definition.rb +33 -9
  37. data/templates/CentOS-6.0-i386-netboot/ks.cfg +19 -30
  38. data/templates/CentOS-6.0-i386-netboot/puppet.sh +12 -0
  39. data/templates/CentOS-6.0-i386-netboot/ruby.sh +3 -0
  40. data/templates/CentOS-6.0-i386-netboot/vagrant.sh +18 -0
  41. data/templates/CentOS-6.0-i386-netboot/virtualbox.sh +8 -0
  42. data/templates/CentOS-6.0-i386-netboot/zerodisk.sh +3 -0
  43. data/templates/CentOS-6.0-i386/base.sh +22 -0
  44. data/templates/CentOS-6.0-i386/chef.sh +3 -0
  45. data/templates/CentOS-6.0-i386/cleanup.sh +5 -0
  46. data/templates/CentOS-6.0-i386/definition.rb +33 -12
  47. data/templates/CentOS-6.0-i386/ks.cfg +12 -18
  48. data/templates/CentOS-6.0-i386/puppet.sh +12 -0
  49. data/templates/CentOS-6.0-i386/ruby.sh +3 -0
  50. data/templates/CentOS-6.0-i386/vagrant.sh +18 -0
  51. data/templates/CentOS-6.0-i386/virtualbox.sh +8 -0
  52. data/templates/CentOS-6.0-i386/zerodisk.sh +3 -0
  53. data/templates/CentOS-6.0-x86_64-minimal/base.sh +22 -0
  54. data/templates/CentOS-6.0-x86_64-minimal/chef.sh +3 -0
  55. data/templates/CentOS-6.0-x86_64-minimal/cleanup.sh +5 -0
  56. data/templates/CentOS-6.0-x86_64-minimal/definition.rb +33 -10
  57. data/templates/CentOS-6.0-x86_64-minimal/ks.cfg +11 -7
  58. data/templates/CentOS-6.0-x86_64-minimal/puppet.sh +12 -0
  59. data/templates/CentOS-6.0-x86_64-minimal/ruby.sh +3 -0
  60. data/templates/CentOS-6.0-x86_64-minimal/vagrant.sh +18 -0
  61. data/templates/CentOS-6.0-x86_64-minimal/virtualbox.sh +8 -0
  62. data/templates/CentOS-6.0-x86_64-minimal/zerodisk.sh +3 -0
  63. data/templates/CentOS-6.0-x86_64-netboot/base.sh +14 -0
  64. data/templates/CentOS-6.0-x86_64-netboot/chef.sh +3 -0
  65. data/templates/CentOS-6.0-x86_64-netboot/cleanup.sh +5 -0
  66. data/templates/CentOS-6.0-x86_64-netboot/definition.rb +32 -8
  67. data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +18 -30
  68. data/templates/CentOS-6.0-x86_64-netboot/puppet.sh +12 -0
  69. data/templates/CentOS-6.0-x86_64-netboot/ruby.sh +3 -0
  70. data/templates/CentOS-6.0-x86_64-netboot/vagrant.sh +18 -0
  71. data/templates/CentOS-6.0-x86_64-netboot/virtualbox.sh +8 -0
  72. data/templates/CentOS-6.0-x86_64-netboot/zerodisk.sh +3 -0
  73. data/templates/CentOS-6.0-x86_64/base.sh +10 -0
  74. data/templates/CentOS-6.0-x86_64/chef.sh +1 -0
  75. data/templates/CentOS-6.0-x86_64/cleanup.sh +1 -0
  76. data/templates/CentOS-6.0-x86_64/definition.rb +16 -7
  77. data/templates/CentOS-6.0-x86_64/ks.cfg +12 -18
  78. data/templates/CentOS-6.0-x86_64/puppet.sh +1 -0
  79. data/templates/CentOS-6.0-x86_64/ruby.sh +2 -1
  80. data/templates/CentOS-6.0-x86_64/vagrant.sh +13 -4
  81. data/templates/CentOS-6.0-x86_64/virtualbox.sh +4 -4
  82. data/templates/CentOS-6.0-x86_64/zerodisk.sh +3 -0
  83. data/templates/CentOS-6.1-x86_64-minimal/base.sh +10 -1
  84. data/templates/CentOS-6.1-x86_64-minimal/chef.sh +1 -0
  85. data/templates/CentOS-6.1-x86_64-minimal/cleanup.sh +1 -0
  86. data/templates/CentOS-6.1-x86_64-minimal/definition.rb +3 -2
  87. data/templates/CentOS-6.1-x86_64-minimal/ks.cfg +13 -18
  88. data/templates/CentOS-6.1-x86_64-minimal/puppet.sh +1 -0
  89. data/templates/CentOS-6.1-x86_64-minimal/ruby.sh +2 -1
  90. data/templates/CentOS-6.1-x86_64-minimal/vagrant.sh +6 -4
  91. data/templates/CentOS-6.1-x86_64-minimal/virtualbox.sh +2 -2
  92. data/templates/CentOS-6.1-x86_64-minimal/zerodisk.sh +3 -0
  93. data/templates/CentOS-6.1-x86_64-netboot/base.sh +2 -1
  94. data/templates/CentOS-6.1-x86_64-netboot/chef.sh +1 -0
  95. data/templates/CentOS-6.1-x86_64-netboot/cleanup.sh +1 -0
  96. data/templates/CentOS-6.1-x86_64-netboot/definition.rb +7 -6
  97. data/templates/CentOS-6.1-x86_64-netboot/ks.cfg +13 -17
  98. data/templates/CentOS-6.1-x86_64-netboot/puppet.sh +1 -0
  99. data/templates/CentOS-6.1-x86_64-netboot/ruby.sh +2 -1
  100. data/templates/CentOS-6.1-x86_64-netboot/vagrant.sh +6 -4
  101. data/templates/CentOS-6.1-x86_64-netboot/virtualbox.sh +3 -3
  102. data/templates/CentOS-6.1-x86_64-netboot/zerodisk.sh +3 -0
  103. data/templates/CentOS-6.2-i386-minimal/base.sh +8 -0
  104. data/templates/CentOS-6.2-i386-minimal/definition.rb +3 -2
  105. data/templates/CentOS-6.2-i386-minimal/ks.cfg +4 -1
  106. data/templates/CentOS-6.2-i386-minimal/vagrant.sh +5 -4
  107. data/templates/CentOS-6.2-i386-minimal/zerodisk.sh +3 -0
  108. data/templates/CentOS-6.2-x86_64-minimal/base.sh +8 -0
  109. data/templates/CentOS-6.2-x86_64-minimal/definition.rb +3 -2
  110. data/templates/CentOS-6.2-x86_64-minimal/ks.cfg +4 -1
  111. data/templates/CentOS-6.2-x86_64-minimal/vagrant.sh +5 -4
  112. data/templates/CentOS-6.2-x86_64-minimal/zerodisk.sh +3 -0
  113. data/templates/CentOS-6.2-x86_64-netboot/base.sh +2 -1
  114. data/templates/CentOS-6.2-x86_64-netboot/chef.sh +1 -0
  115. data/templates/CentOS-6.2-x86_64-netboot/cleanup.sh +1 -0
  116. data/templates/CentOS-6.2-x86_64-netboot/definition.rb +7 -6
  117. data/templates/CentOS-6.2-x86_64-netboot/ks.cfg +13 -17
  118. data/templates/CentOS-6.2-x86_64-netboot/puppet.sh +1 -0
  119. data/templates/CentOS-6.2-x86_64-netboot/ruby.sh +2 -1
  120. data/templates/CentOS-6.2-x86_64-netboot/vagrant.sh +6 -4
  121. data/templates/CentOS-6.2-x86_64-netboot/virtualbox.sh +3 -3
  122. data/templates/CentOS-6.2-x86_64-netboot/zerodisk.sh +3 -0
  123. data/templates/CentOS-6.3-i386-minimal/definition.rb +2 -1
  124. data/templates/CentOS-6.3-i386-minimal/vagrant.sh +5 -4
  125. data/templates/CentOS-6.3-i386-minimal/zerodisk.sh +3 -0
  126. data/templates/CentOS-6.3-x86_64-minimal/definition.rb +2 -1
  127. data/templates/CentOS-6.3-x86_64-minimal/vagrant.sh +5 -4
  128. data/templates/CentOS-6.3-x86_64-minimal/zerodisk.sh +3 -0
  129. data/templates/Debian-5.0.10-amd64-netboot/base.sh +9 -0
  130. data/templates/Debian-5.0.10-amd64-netboot/chef.sh +2 -0
  131. data/templates/Debian-5.0.10-amd64-netboot/cleanup.sh +10 -0
  132. data/templates/Debian-5.0.10-amd64-netboot/definition.rb +39 -0
  133. data/templates/Debian-5.0.10-amd64-netboot/postinstall.sh +60 -0
  134. data/templates/Debian-5.0.10-amd64-netboot/preseed.cfg +312 -0
  135. data/templates/Debian-5.0.10-amd64-netboot/puppet.sh +2 -0
  136. data/templates/Debian-5.0.10-amd64-netboot/ruby.sh +11 -0
  137. data/templates/Debian-5.0.10-amd64-netboot/vagrant.sh +14 -0
  138. data/templates/Debian-5.0.10-amd64-netboot/virtualbox.sh +15 -0
  139. data/templates/Debian-5.0.10-i386-netboot/base.sh +9 -0
  140. data/templates/Debian-5.0.10-i386-netboot/chef.sh +2 -0
  141. data/templates/Debian-5.0.10-i386-netboot/cleanup.sh +10 -0
  142. data/templates/Debian-5.0.10-i386-netboot/definition.rb +39 -0
  143. data/templates/Debian-5.0.10-i386-netboot/postinstall.sh +60 -0
  144. data/templates/Debian-5.0.10-i386-netboot/preseed.cfg +312 -0
  145. data/templates/Debian-5.0.10-i386-netboot/puppet.sh +2 -0
  146. data/templates/Debian-5.0.10-i386-netboot/ruby.sh +11 -0
  147. data/templates/Debian-5.0.10-i386-netboot/vagrant.sh +14 -0
  148. data/templates/Debian-5.0.10-i386-netboot/virtualbox.sh +15 -0
  149. data/templates/Debian-5.0.8-amd64-netboot/preseed.cfg +2 -2
  150. data/templates/Debian-5.0.8-i386-netboot/preseed.cfg +2 -2
  151. data/templates/Debian-6.0.4-amd64-netboot/definition.rb +1 -1
  152. data/templates/Debian-6.0.4-amd64-netboot/vagrant.sh +5 -1
  153. data/templates/Debian-6.0.4-i386-netboot/definition.rb +1 -1
  154. data/templates/Debian-6.0.4-i386-netboot/vagrant.sh +5 -1
  155. data/templates/Debian-6.0.5-amd64-netboot/vagrant.sh +5 -1
  156. data/templates/Debian-6.0.5-i386-netboot/vagrant.sh +5 -1
  157. data/templates/SLES-11-SP1-DVD-i586-GM/postinstall.sh +3 -0
  158. data/templates/SLES-11-SP1-DVD-x86_64-GM/postinstall.sh +3 -0
  159. data/templates/gentoo-latest-i386-experimental/definition.rb +20 -4
  160. data/templates/gentoo-latest-x86_64-experimental/definition.rb +23 -12
  161. data/templates/scientificlinux-6.1-i386-netboot/definition.rb +1 -2
  162. data/templates/scientificlinux-6.3-i386-netboot/base.sh +1 -0
  163. data/templates/scientificlinux-6.3-i386-netboot/chef.sh +1 -0
  164. data/templates/scientificlinux-6.3-i386-netboot/cleanup.sh +4 -0
  165. data/templates/scientificlinux-6.3-i386-netboot/definition.rb +37 -0
  166. data/templates/scientificlinux-6.3-i386-netboot/ks.cfg +53 -0
  167. data/templates/{CentOS-6.0-i386-netboot → scientificlinux-6.3-i386-netboot}/postinstall.sh +2 -2
  168. data/templates/scientificlinux-6.3-i386-netboot/puppet.sh +1 -0
  169. data/templates/scientificlinux-6.3-i386-netboot/ruby.sh +1 -0
  170. data/templates/scientificlinux-6.3-i386-netboot/vagrant.sh +8 -0
  171. data/templates/scientificlinux-6.3-i386-netboot/virtualbox.sh +8 -0
  172. data/templates/scientificlinux-6.3-x86_64-netboot/base.sh +1 -0
  173. data/templates/scientificlinux-6.3-x86_64-netboot/chef.sh +1 -0
  174. data/templates/scientificlinux-6.3-x86_64-netboot/cleanup.sh +4 -0
  175. data/templates/scientificlinux-6.3-x86_64-netboot/definition.rb +37 -0
  176. data/templates/scientificlinux-6.3-x86_64-netboot/ks.cfg +53 -0
  177. data/templates/{CentOS-6.0-x86_64-netboot → scientificlinux-6.3-x86_64-netboot}/postinstall.sh +2 -2
  178. data/templates/scientificlinux-6.3-x86_64-netboot/puppet.sh +1 -0
  179. data/templates/scientificlinux-6.3-x86_64-netboot/ruby.sh +1 -0
  180. data/templates/scientificlinux-6.3-x86_64-netboot/rvm-ruby.sh +9 -0
  181. data/templates/scientificlinux-6.3-x86_64-netboot/vagrant.sh +8 -0
  182. data/templates/scientificlinux-6.3-x86_64-netboot/virtualbox.sh +8 -0
  183. data/templates/ubuntu-10.04.3-server-i386/postinstall.sh +5 -5
  184. data/templates/{ubuntu-12.04-server-amd64-packages → ubuntu-12.04.1-server-amd64-packages}/definition.rb +3 -3
  185. data/templates/{ubuntu-12.04-server-amd64-packages → ubuntu-12.04.1-server-amd64-packages}/postinstall.sh +0 -0
  186. data/templates/{ubuntu-12.04-server-amd64-packages → ubuntu-12.04.1-server-amd64-packages}/preseed.cfg +0 -0
  187. data/templates/{ubuntu-12.04-server-amd64 → ubuntu-12.04.1-server-amd64}/definition.rb +3 -3
  188. data/templates/{ubuntu-12.04-server-amd64 → ubuntu-12.04.1-server-amd64}/postinstall.sh +0 -0
  189. data/templates/{ubuntu-12.04-server-amd64 → ubuntu-12.04.1-server-amd64}/preseed.cfg +0 -0
  190. data/templates/{ubuntu-12.04-server-i386-packages → ubuntu-12.04.1-server-i386-packages}/definition.rb +3 -3
  191. data/templates/{ubuntu-12.04-server-i386-packages → ubuntu-12.04.1-server-i386-packages}/postinstall.sh +0 -0
  192. data/templates/{ubuntu-12.04-server-i386-packages → ubuntu-12.04.1-server-i386-packages}/preseed.cfg +0 -0
  193. data/templates/{ubuntu-12.04-server-i386 → ubuntu-12.04.1-server-i386}/definition.rb +3 -3
  194. data/templates/{ubuntu-12.04-server-i386 → ubuntu-12.04.1-server-i386}/postinstall.sh +0 -0
  195. data/templates/{ubuntu-12.04-server-i386 → ubuntu-12.04.1-server-i386}/preseed.cfg +0 -0
  196. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/Autounattend.xml +0 -0
  197. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/README.md +0 -0
  198. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/cygwin-setup.exe +0 -0
  199. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/definition.rb +3 -3
  200. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/install-cygwin-sshd.bat +0 -0
  201. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/install-winrm.bat +0 -0
  202. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/oracle-cert.cer +0 -0
  203. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/postinstall.sh +0 -0
  204. data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/winrm.rb +0 -0
  205. data/validation/veewee.feature +6 -6
  206. metadata +306 -157
  207. data/templates/CentOS-6.0-i386/postinstall.sh +0 -48
  208. data/templates/CentOS-6.0-x86_64-minimal/postinstall.sh +0 -58
  209. data/templates/CentOS-6.0-x86_64/postinstall.sh +0 -48
  210. data/templates/CentOS-6.1-x86_64-netboot/postinstall.sh +0 -48
  211. data/templates/CentOS-6.2-x86_64-netboot/postinstall.sh +0 -48
data/README.md CHANGED
@@ -11,18 +11,18 @@ Besides building Vagrant boxes, veewee can also be used for:
11
11
 
12
12
  Before you start read through:
13
13
 
14
- - the [requirements](veewee/tree/master/doc/requirements.md)
15
- - the [installation](veewee/tree/master/doc/installation.md) procedure
14
+ - the [requirements](https://github.com/jedi4ever/veewee/tree/master/doc/requirements.md)
15
+ - the [installation](https://github.com/jedi4ever/veewee/tree/master/doc/installation.md) procedure
16
16
 
17
17
  Depending on how you want to use veewee, read through one of the following guides: (**work in progres**)
18
18
 
19
- - [guide for vagrant](veewee/tree/master/doc/vagrant.md)
19
+ - [guide for vagrant](https://github.com/jedi4ever/veewee/tree/master/doc/vagrant.md)
20
20
 
21
- - [guide for Virtualbox](veewee/tree/master/doc/vbox.md)
22
- - [guide for Vmware fusion](veewee/tree/master/doc/fusion.md)
23
- - [guide for KVM](veewee/tree/master/doc/kvm.md)
21
+ - [guide for Virtualbox](https://github.com/jedi4ever/veewee/tree/master/doc/vbox.md)
22
+ - [guide for Vmware fusion](https://github.com/jedi4ever/veewee/tree/master/doc/fusion.md)
23
+ - [guide for KVM](https://github.com/jedi4ever/veewee/tree/master/doc/kvm.md)
24
24
 
25
- You can also look at the more detailed pages on each subject in the [documentation directory](veewee/tree/master/doc)
25
+ You can also look at the more detailed pages on each subject in the [documentation directory](https://github.com/jedi4ever/veewee/tree/master/doc)
26
26
 
27
27
  People have reported good experiences, why don't you give it a try?
28
28
 
data/Rakefile CHANGED
@@ -42,20 +42,39 @@ task :iso, [:template_name] do |t,args|
42
42
  response = nil
43
43
  while found==false
44
44
  uri=URI.parse(url)
45
- Net::HTTP.start(uri.host,uri.port) {|http|
46
- response = http.head(uri.path)
47
- }
48
- unless response['location'].nil?
49
- #puts "Redirecting to "+response['location']
50
- url=response['location']
51
- else
52
- found=true
45
+ if uri.is_a?(URI::HTTP)
46
+ Net::HTTP.start(uri.host,uri.port) {|http|
47
+ response = http.head(uri.path)
48
+ }
49
+ unless response['location'].nil?
50
+ #puts "Redirecting to "+response['location']
51
+ url=response['location']
52
+ else
53
+ length=response['content-length']
54
+ found=true
55
+ end
56
+ elsif uri.is_a?(URI::FTP)
57
+ require 'net/ftp'
58
+ ftp = Net::FTP.new(uri.host)
59
+ ftp.login
60
+ begin
61
+ length = ftp.size(uri.path)
62
+ found = true
63
+ rescue Net::FTPReplyError => e
64
+ reply = e.message
65
+ err_code = reply[0,3].to_i
66
+ unless err_code == 500 || err_code == 502
67
+ # other problem, raise
68
+ raise "Got ftp site but doesn't support size subcommand"
69
+ end
70
+ # fallback solution
71
+ end
72
+
53
73
  end
54
74
  end
55
- length=response['content-length']
56
75
  if length.to_i < 10000
57
76
  puts definition.iso_src
58
- p response['content-type']
77
+ puts "Incorrect length #{length.to_i}"
59
78
  puts uri.host,uri.port, uri.path,response.code
60
79
  end
61
80
  rescue Exception => ex
data/bin/veewee CHANGED
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
+ begin
3
+ require 'rubygems'
4
+ rescue LoadError
5
+ end
6
+
2
7
  require 'veewee'
3
8
 
4
9
  env = Veewee::Environment.new
@@ -17,7 +17,7 @@ this is essentially making a copy based on the templates provided above.
17
17
 
18
18
  Veewee::Definition.declare( {
19
19
  :cpu_count => '1', :memory_size=> '256',
20
- :disk_size => '10140', :disk_format => 'VDI',
20
+ :disk_size => '10140', :disk_format => 'VDI', :disk_variant => 'Standard',
21
21
  :os_type_id => 'Ubuntu',
22
22
  :iso_file => "ubuntu-10.10-server-i386.iso",
23
23
  :iso_src => "http://releases.ubuntu.com/maverick/ubuntu-10.10-server-i386.iso",
@@ -104,7 +104,7 @@ I suggest the easiest way is to get an account on github and fork of the veewee
104
104
 
105
105
  If you don't use rvm, be sure to execute vagrant through bundle exec
106
106
 
107
- $ alias vagrant="bundle exec vagrant"
107
+ $ alias veewee="bundle exec veewee"
108
108
 
109
109
  Start of an existing one
110
110
 
@@ -81,6 +81,7 @@ module Veewee
81
81
 
82
82
  desc "validate [NAME]", "Validates a box against vmfusion compliancy rules"
83
83
  method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
84
+ method_option :tags, :type => :array , :default => %w{vmfusion puppet chef}, :aliases => "-t", :desc => "tags to validate"
84
85
  def validate(box_name)
85
86
  venv=Veewee::Environment.new(options)
86
87
  venv.ui=env.ui
@@ -82,6 +82,7 @@ module Veewee
82
82
 
83
83
  desc "validate [NAME]", "Validates a box against kvm compliancy rules"
84
84
  method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
85
+ method_option :tags,:type => :array , :default => %w{kvm puppet chef}, :aliases => "-t", :desc => "tags to validate"
85
86
  def validate(box_name)
86
87
  venv=Veewee::Environment.new(options)
87
88
  venv.ui=env.ui
@@ -79,6 +79,7 @@ module Veewee
79
79
 
80
80
  desc "validate [NAME]", "Validates a box against parallels compliancy rules"
81
81
  method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
82
+ method_option :tags,:type => :array, :default => %w{parallels puppet chef}, :aliases => "-t", :desc => "tags to validate"
82
83
  def validate(box_name)
83
84
  venv=Veewee::Environment.new(options)
84
85
  venv.ui=env.ui
@@ -5,7 +5,9 @@ module Veewee
5
5
  module Vagrant
6
6
  class Validate < ::Vagrant::Command::Base
7
7
  def execute
8
- options = {}
8
+ options = {
9
+ 'tags' => %w{vagrant puppet chef virtualbox}
10
+ }
9
11
 
10
12
  opts = OptionParser.new do |opts|
11
13
  opts.banner = "Validates a box against vagrant compliancy rules"
@@ -16,8 +18,8 @@ module Veewee
16
18
  options['debug'] = d
17
19
  end
18
20
 
19
- opts.on("-f", "--force", "force overwrite") do |f|
20
- options['force'] = f
21
+ opts.on("-t", "--tags vagrant,puppet,chef", Array, "tags to validate") do |t|
22
+ options['tags'] = t
21
23
  end
22
24
 
23
25
  end
@@ -114,6 +114,7 @@ module Veewee
114
114
 
115
115
  desc "validate [NAME]", "Validates a box against vagrant compliancy rules"
116
116
  method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
117
+ method_option :tags, :type => :array , :default => %w{vagrant virtualbox puppet chef}, :aliases => "-t", :desc => "tags to validate"
117
118
  def validate(box_name)
118
119
  begin
119
120
  venv=Veewee::Environment.new(options)
@@ -112,7 +112,7 @@ FreeBSD:
112
112
  FreeBSD_64:
113
113
  :fusion: FreeBSD_64
114
114
  :kvm:
115
- :vbox: FreeBSD-64
115
+ :vbox: FreeBSD_64
116
116
  :parallels: freebsd
117
117
  Oracle:
118
118
  :fusion: oraclelinux
@@ -134,6 +134,16 @@ Debian_64:
134
134
  :kvm:
135
135
  :vbox: Debian_64
136
136
  :parallels: debian
137
+ Debian6:
138
+ :fusion: debian6
139
+ :kvm:
140
+ :vbox: Debian
141
+ :parallels: debian
142
+ Debian6_64:
143
+ :fusion: debian6-64
144
+ :kvm:
145
+ :vbox: Debian_64
146
+ :parallels: debian
137
147
  Gentoo:
138
148
  :fusion: other26xlinux
139
149
  :kvm:
@@ -179,7 +189,27 @@ RedHat_64:
179
189
  :kvm:
180
190
  :vbox: RedHat_64
181
191
  :parallels: redhat
182
- Centos4:
192
+ RedHat5:
193
+ :fusion: rhel5
194
+ :kvm:
195
+ :vbox: RedHat
196
+ :parallels: redhat
197
+ RedHat5_64:
198
+ :fusion: rhel5-64
199
+ :kvm:
200
+ :vbox: RedHat_64
201
+ :parallels: redhat
202
+ RedHat6:
203
+ :fusion: rhel6
204
+ :kvm:
205
+ :vbox: RedHat
206
+ :parallels: redhat
207
+ RedHat6_64:
208
+ :fusion: rhel6-64
209
+ :kvm:
210
+ :vbox: RedHat_64
211
+ :parallels: redhat
212
+ Centos:
183
213
  :fusion: centos
184
214
  :kvm:
185
215
  :vbox: RedHat
@@ -219,6 +249,10 @@ SUSE_64:
219
249
  :kvm:
220
250
  :vbox: OpenSUSE_64
221
251
  :parallels: suse
252
+ SLES11:
253
+ :fusion: sles11
254
+ SLES11_64:
255
+ :fusion: sles11-64
222
256
  Fedora:
223
257
  :fusion: fedora
224
258
  :kvm:
@@ -11,7 +11,7 @@ module Veewee
11
11
  attr_accessor :path
12
12
 
13
13
  attr_accessor :cpu_count,:memory_size,:iso_file
14
- attr_accessor :disk_size, :disk_format
14
+ attr_accessor :disk_size, :disk_format, :disk_variant
15
15
 
16
16
  attr_accessor :os_type_id
17
17
 
@@ -72,7 +72,7 @@ module Veewee
72
72
  @postinstall_files=[]; @postinstall_timeout = 10000;
73
73
 
74
74
  @iso_file=""
75
- @disk_size = '10240'; @disk_format = 'VDI'
75
+ @disk_size = '10240'; @disk_format = 'VDI'; @disk_variant = 'Standard'
76
76
 
77
77
  # :hostiocache => 'off' ,
78
78
  # :os_type_id => 'Ubuntu',
@@ -80,7 +80,9 @@ module Veewee
80
80
 
81
81
  # We need to set this variable before the first call to the logger object
82
82
  if options.has_key?("debug")
83
- ENV['VEEWEE_LOG']="STDOUT"
83
+ if options["debug"] == true
84
+ ENV['VEEWEE_LOG']="STDOUT"
85
+ end
84
86
  end
85
87
 
86
88
  logger.info("environment") { "Environment initialized (#{self})" }
@@ -13,6 +13,7 @@ require 'veewee/provider/core/box/sudo'
13
13
  require 'veewee/provider/core/box/ssh'
14
14
  require 'veewee/provider/core/box/issh'
15
15
  require 'veewee/provider/core/box/floppy'
16
+ require 'veewee/provider/core/box/validate_tags'
16
17
 
17
18
  module Veewee
18
19
  module Provider
@@ -21,6 +22,7 @@ module Veewee
21
22
  attr_accessor :definition
22
23
  attr_accessor :env
23
24
  attr_accessor :name
25
+ attr_accessor :provider
24
26
 
25
27
  include ::Veewee::Provider::Core::Helper::Tcp
26
28
  include ::Veewee::Provider::Core::Helper::Web
@@ -70,7 +70,7 @@ module Veewee
70
70
  # This needs to be done after the kickstart:
71
71
  # As the dhcp request will likely occur just before the kickstart fetch
72
72
  until !self.ip_address.nil?
73
- env.logger.info "wait for Ip addres"
73
+ env.logger.info "wait for Ip address"
74
74
  sleep 2
75
75
  end
76
76
 
@@ -119,7 +119,7 @@ module Veewee
119
119
  unless options["postinstall_exclude"].nil?
120
120
  options["postinstall_exclude"].each do |p|
121
121
  env.logger.info "Exclude pattern #{p}"
122
- new_definition.postinstall_files.collect! { |f| f.match(p) ? f.gsub(/^/,"_"): f}
122
+ new_definition.postinstall_files.reject! { |f| f.match(p) }
123
123
  end
124
124
  end
125
125
 
@@ -10,7 +10,7 @@ module Veewee
10
10
  new_options=ssh_options.merge(options)
11
11
  self.when_ssh_login_works(self.ip_address,new_options) do
12
12
  begin
13
- env.logger.info "About to transfer #{localfile} to #{remotefile} to the box #{name} - #{self.ip_address} - #{new_options}"
13
+ env.logger.info "About to transfer #{localfile} to #{remotefile} to the box #{name} - #{self.ip_address} - #{new_options.inspect}"
14
14
  self.ssh_transfer_file(self.ip_address,localfile,remotefile,new_options)
15
15
  rescue RuntimeError => ex
16
16
  ui.error("Error transfering file #{localfile} failed, possible not enough permissions to write? #{ex}",:prefix => false)
@@ -0,0 +1,58 @@
1
+ module Veewee
2
+ module Provider
3
+ module Core
4
+ module BoxCommand
5
+
6
+ def validate_tags(tags,options)
7
+
8
+ unless self.exists?
9
+ ui.error "Error:: You tried to validate box '#{name}' but it does not exit"
10
+ exit -1
11
+ end
12
+
13
+ unless self.running?
14
+ ui.error "Error:: You tried to validate box '#{name}' but it is not running"
15
+ exit -1
16
+ end
17
+
18
+ require 'cucumber'
19
+
20
+ require 'cucumber/rspec/disable_option_parser'
21
+ require 'cucumber/cli/main'
22
+
23
+ # Passing ssh options via ENV varialbles to cucumber
24
+ # VEEWEE_SSH_USER, VEEWEE_SSH_PASSWORD ,VEEWEE_SSH_PORT
25
+ cucumber_vars=ssh_options
26
+ cucumber_vars.each do |key,value|
27
+ ENV['VEEWEE_'+key.to_s.upcase]=cucumber_vars[key].to_s
28
+ end
29
+
30
+ # Pass the name of the box
31
+ ENV['VEEWEE_BOXNAME']=@name
32
+ ENV['VEEWEE_PROVIDER']=@provider.name
33
+
34
+ feature_path=File.join(File.dirname(__FILE__),"..","..","..","..","..","validation","veewee.feature")
35
+
36
+ features=Array.new
37
+ features[0]=feature_path
38
+ features << "--tags"
39
+ features << tags.map {|t| "@#{t}"}.join(',')
40
+
41
+ begin
42
+ # The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
43
+ failure = Cucumber::Cli::Main.execute(features.dup)
44
+ Kernel.exit(failure ? 1 : 0)
45
+ rescue SystemExit => e
46
+ Kernel.exit(e.status)
47
+ rescue Exception => e
48
+ ui.error("#{e.message} (#{e.class})")
49
+ ui.error(e.backtrace.join("\n"))
50
+ Kernel.exit(1)
51
+ end
52
+
53
+ end
54
+ end #Module
55
+
56
+ end #Module
57
+ end #Module
58
+ end #Module
@@ -35,6 +35,11 @@ module Veewee
35
35
 
36
36
  # Get a real box object from the Provider
37
37
  box=Object.const_get("Veewee").const_get("Provider").const_get(type.to_s.capitalize).const_get("Box").new(name,env)
38
+
39
+ # Attach the provider to the box
40
+ box.provider = self
41
+
42
+ return box
38
43
  rescue Error => ex
39
44
  ui.error "Could not instante the box #{name} with provider #{type} ,#{ex}"
40
45
  raise
@@ -21,8 +21,8 @@ module Veewee
21
21
  :memory_size => definition.memory_size.to_i*1024,
22
22
  :cpus => definition.cpu_count.to_i,
23
23
  :volume_capacity => "#{definition.disk_size}M",
24
- :network_interface_type => "nat",
25
24
  :domain_type => options['use_emulation'] ? 'qemu': 'kvm',
25
+ :network_interface_type => "network",
26
26
  :iso_file => definition.iso_file,
27
27
  :arch => definition.os_type_id.end_with?("_64") ? "x86_64" : "i686",
28
28
  :iso_dir => env.config.veewee.iso_dir
@@ -64,7 +64,7 @@ module Veewee
64
64
  # Get the raw xml of the changed document
65
65
  new_xml=domain_doc.to_xml
66
66
 
67
- # Undefine the existing domain
67
+ # Undefine the existing domain
68
68
  s.undefine
69
69
 
70
70
  # Re-define the domain
@@ -8,9 +8,9 @@ module Veewee
8
8
  module BoxCommand
9
9
  # Type on the console
10
10
  def console_type(sequence,type_options={})
11
- vnc_port=@connection.servers.all(:name => name).first.vnc_port
12
- display_port=vnc_port.to_i - 5900
13
- ui.success "Sending keystrokes to VNC port :#{display_port} - TCP port: #{vnc_port}"
11
+ tcp_port=@connection.servers.all(:name => name).first.display[:port]
12
+ display_port=tcp_port.to_i - 5900
13
+ ui.success "Sending keystrokes to VNC port :#{display_port} - TCP port: #{tcp_port}"
14
14
  vnc_type(sequence,"127.0.0.1",display_port)
15
15
  end
16
16
 
@@ -3,8 +3,8 @@ module Veewee
3
3
  module Kvm
4
4
  module BoxCommand
5
5
  def ip_address
6
- ip=@connection.servers.all(:name => "#{name}").first.addresses[:public]
7
- return ip.first unless ip.nil?
6
+ ip=@connection.servers.all(:name => "#{name}").first.public_ip_address
7
+ return [*ip].first unless ip.nil?
8
8
  return ip
9
9
  end
10
10
 
@@ -15,11 +15,11 @@ module Veewee
15
15
  end
16
16
 
17
17
  def exists_volume?
18
- !@connection.volumes.all(:name => "#{name}.img").nil?
18
+ @connection.list_volumes.find { |v| v[:name] == "#{name}.img" }
19
19
  end
20
20
 
21
21
  def exists_vm?
22
- !@connection.servers.all(:name => name).nil?
22
+ @connection.list_domains.find { |d| d[:name] == name }
23
23
  end
24
24
 
25
25
  end # End Module
@@ -4,40 +4,8 @@ module Veewee
4
4
  module BoxCommand
5
5
 
6
6
  def validate_kvm(options)
7
- require 'cucumber'
8
7
 
9
- require 'cucumber/rspec/disable_option_parser'
10
- require 'cucumber/cli/main'
11
-
12
- # Passing ssh options via ENV varialbles to cucumber
13
- # VEEWEE_SSH_USER, VEEWEE_SSH_PASSWORD ,VEEWEE_SSH_PORT
14
- cucumber_vars=ssh_options
15
- cucumber_vars.each do |key,value|
16
- ENV['VEEWEE_'+key.to_s.upcase]=cucumber_vars[key].to_s
17
- end
18
-
19
- # Pass the name of the box
20
- ENV['VEEWEE_BOXNAME']=@name
21
- ENV['VEEWEE_PROVIDER']="kvm"
22
-
23
- feature_path=File.join(File.dirname(__FILE__),"..","..","..","..","..","validation","veewee.feature")
24
-
25
- features=Array.new
26
- features[0]=feature_path
27
- features[1]="--tags"
28
- features[2]="@kvm"
29
-
30
- begin
31
- # The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
32
- failure = Cucumber::Cli::Main.execute(features.dup)
33
- Kernel.exit(failure ? 1 : 0)
34
- rescue SystemExit => e
35
- Kernel.exit(e.status)
36
- rescue Exception => e
37
- ui.error("#{e.message} (#{e.class})")
38
- ui.error(e.backtrace.join("\n"))
39
- Kernel.exit(1)
40
- end
8
+ validate_tags( [ 'vbox', 'puppet', 'chef'],options)
41
9
 
42
10
  end
43
11
  end #Module