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.
- data/README.md +7 -7
- data/Rakefile +29 -10
- data/bin/veewee +5 -0
- data/doc/vagrant.md +2 -2
- data/lib/veewee/command/fusion.rb +1 -0
- data/lib/veewee/command/kvm.rb +1 -0
- data/lib/veewee/command/parallels.rb +1 -0
- data/lib/veewee/command/vagrant/validate.rb +5 -3
- data/lib/veewee/command/vbox.rb +1 -0
- data/lib/veewee/config/ostypes.yml +36 -2
- data/lib/veewee/definition.rb +2 -2
- data/lib/veewee/environment.rb +3 -1
- data/lib/veewee/provider/core/box.rb +2 -0
- data/lib/veewee/provider/core/box/build.rb +2 -2
- data/lib/veewee/provider/core/box/scp.rb +1 -1
- data/lib/veewee/provider/core/box/validate_tags.rb +58 -0
- data/lib/veewee/provider/core/provider.rb +5 -0
- data/lib/veewee/provider/kvm/box/create.rb +2 -2
- data/lib/veewee/provider/kvm/box/helper/console_type.rb +3 -3
- data/lib/veewee/provider/kvm/box/helper/ip.rb +2 -2
- data/lib/veewee/provider/kvm/box/helper/status.rb +2 -2
- data/lib/veewee/provider/kvm/box/validate_kvm.rb +1 -33
- data/lib/veewee/provider/kvm/provider.rb +1 -1
- data/lib/veewee/provider/parallels/box/validate_parallels.rb +1 -35
- data/lib/veewee/provider/virtualbox/box/helper/create.rb +3 -3
- data/lib/veewee/provider/virtualbox/box/validate_vagrant.rb +2 -42
- data/lib/veewee/provider/vmfusion/box/helper/buildinfo.rb +7 -3
- data/lib/veewee/provider/vmfusion/box/template.rb +9 -0
- data/lib/veewee/provider/vmfusion/box/template.vmx.erb +1 -1
- data/lib/veewee/provider/vmfusion/box/validate_vmfusion.rb +1 -35
- data/lib/veewee/provider/vmfusion/provider.rb +14 -10
- data/lib/veewee/version.rb +1 -1
- data/templates/CentOS-6.0-i386-netboot/base.sh +14 -0
- data/templates/CentOS-6.0-i386-netboot/chef.sh +3 -0
- data/templates/CentOS-6.0-i386-netboot/cleanup.sh +5 -0
- data/templates/CentOS-6.0-i386-netboot/definition.rb +33 -9
- data/templates/CentOS-6.0-i386-netboot/ks.cfg +19 -30
- data/templates/CentOS-6.0-i386-netboot/puppet.sh +12 -0
- data/templates/CentOS-6.0-i386-netboot/ruby.sh +3 -0
- data/templates/CentOS-6.0-i386-netboot/vagrant.sh +18 -0
- data/templates/CentOS-6.0-i386-netboot/virtualbox.sh +8 -0
- data/templates/CentOS-6.0-i386-netboot/zerodisk.sh +3 -0
- data/templates/CentOS-6.0-i386/base.sh +22 -0
- data/templates/CentOS-6.0-i386/chef.sh +3 -0
- data/templates/CentOS-6.0-i386/cleanup.sh +5 -0
- data/templates/CentOS-6.0-i386/definition.rb +33 -12
- data/templates/CentOS-6.0-i386/ks.cfg +12 -18
- data/templates/CentOS-6.0-i386/puppet.sh +12 -0
- data/templates/CentOS-6.0-i386/ruby.sh +3 -0
- data/templates/CentOS-6.0-i386/vagrant.sh +18 -0
- data/templates/CentOS-6.0-i386/virtualbox.sh +8 -0
- data/templates/CentOS-6.0-i386/zerodisk.sh +3 -0
- data/templates/CentOS-6.0-x86_64-minimal/base.sh +22 -0
- data/templates/CentOS-6.0-x86_64-minimal/chef.sh +3 -0
- data/templates/CentOS-6.0-x86_64-minimal/cleanup.sh +5 -0
- data/templates/CentOS-6.0-x86_64-minimal/definition.rb +33 -10
- data/templates/CentOS-6.0-x86_64-minimal/ks.cfg +11 -7
- data/templates/CentOS-6.0-x86_64-minimal/puppet.sh +12 -0
- data/templates/CentOS-6.0-x86_64-minimal/ruby.sh +3 -0
- data/templates/CentOS-6.0-x86_64-minimal/vagrant.sh +18 -0
- data/templates/CentOS-6.0-x86_64-minimal/virtualbox.sh +8 -0
- data/templates/CentOS-6.0-x86_64-minimal/zerodisk.sh +3 -0
- data/templates/CentOS-6.0-x86_64-netboot/base.sh +14 -0
- data/templates/CentOS-6.0-x86_64-netboot/chef.sh +3 -0
- data/templates/CentOS-6.0-x86_64-netboot/cleanup.sh +5 -0
- data/templates/CentOS-6.0-x86_64-netboot/definition.rb +32 -8
- data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +18 -30
- data/templates/CentOS-6.0-x86_64-netboot/puppet.sh +12 -0
- data/templates/CentOS-6.0-x86_64-netboot/ruby.sh +3 -0
- data/templates/CentOS-6.0-x86_64-netboot/vagrant.sh +18 -0
- data/templates/CentOS-6.0-x86_64-netboot/virtualbox.sh +8 -0
- data/templates/CentOS-6.0-x86_64-netboot/zerodisk.sh +3 -0
- data/templates/CentOS-6.0-x86_64/base.sh +10 -0
- data/templates/CentOS-6.0-x86_64/chef.sh +1 -0
- data/templates/CentOS-6.0-x86_64/cleanup.sh +1 -0
- data/templates/CentOS-6.0-x86_64/definition.rb +16 -7
- data/templates/CentOS-6.0-x86_64/ks.cfg +12 -18
- data/templates/CentOS-6.0-x86_64/puppet.sh +1 -0
- data/templates/CentOS-6.0-x86_64/ruby.sh +2 -1
- data/templates/CentOS-6.0-x86_64/vagrant.sh +13 -4
- data/templates/CentOS-6.0-x86_64/virtualbox.sh +4 -4
- data/templates/CentOS-6.0-x86_64/zerodisk.sh +3 -0
- data/templates/CentOS-6.1-x86_64-minimal/base.sh +10 -1
- data/templates/CentOS-6.1-x86_64-minimal/chef.sh +1 -0
- data/templates/CentOS-6.1-x86_64-minimal/cleanup.sh +1 -0
- data/templates/CentOS-6.1-x86_64-minimal/definition.rb +3 -2
- data/templates/CentOS-6.1-x86_64-minimal/ks.cfg +13 -18
- data/templates/CentOS-6.1-x86_64-minimal/puppet.sh +1 -0
- data/templates/CentOS-6.1-x86_64-minimal/ruby.sh +2 -1
- data/templates/CentOS-6.1-x86_64-minimal/vagrant.sh +6 -4
- data/templates/CentOS-6.1-x86_64-minimal/virtualbox.sh +2 -2
- data/templates/CentOS-6.1-x86_64-minimal/zerodisk.sh +3 -0
- data/templates/CentOS-6.1-x86_64-netboot/base.sh +2 -1
- data/templates/CentOS-6.1-x86_64-netboot/chef.sh +1 -0
- data/templates/CentOS-6.1-x86_64-netboot/cleanup.sh +1 -0
- data/templates/CentOS-6.1-x86_64-netboot/definition.rb +7 -6
- data/templates/CentOS-6.1-x86_64-netboot/ks.cfg +13 -17
- data/templates/CentOS-6.1-x86_64-netboot/puppet.sh +1 -0
- data/templates/CentOS-6.1-x86_64-netboot/ruby.sh +2 -1
- data/templates/CentOS-6.1-x86_64-netboot/vagrant.sh +6 -4
- data/templates/CentOS-6.1-x86_64-netboot/virtualbox.sh +3 -3
- data/templates/CentOS-6.1-x86_64-netboot/zerodisk.sh +3 -0
- data/templates/CentOS-6.2-i386-minimal/base.sh +8 -0
- data/templates/CentOS-6.2-i386-minimal/definition.rb +3 -2
- data/templates/CentOS-6.2-i386-minimal/ks.cfg +4 -1
- data/templates/CentOS-6.2-i386-minimal/vagrant.sh +5 -4
- data/templates/CentOS-6.2-i386-minimal/zerodisk.sh +3 -0
- data/templates/CentOS-6.2-x86_64-minimal/base.sh +8 -0
- data/templates/CentOS-6.2-x86_64-minimal/definition.rb +3 -2
- data/templates/CentOS-6.2-x86_64-minimal/ks.cfg +4 -1
- data/templates/CentOS-6.2-x86_64-minimal/vagrant.sh +5 -4
- data/templates/CentOS-6.2-x86_64-minimal/zerodisk.sh +3 -0
- data/templates/CentOS-6.2-x86_64-netboot/base.sh +2 -1
- data/templates/CentOS-6.2-x86_64-netboot/chef.sh +1 -0
- data/templates/CentOS-6.2-x86_64-netboot/cleanup.sh +1 -0
- data/templates/CentOS-6.2-x86_64-netboot/definition.rb +7 -6
- data/templates/CentOS-6.2-x86_64-netboot/ks.cfg +13 -17
- data/templates/CentOS-6.2-x86_64-netboot/puppet.sh +1 -0
- data/templates/CentOS-6.2-x86_64-netboot/ruby.sh +2 -1
- data/templates/CentOS-6.2-x86_64-netboot/vagrant.sh +6 -4
- data/templates/CentOS-6.2-x86_64-netboot/virtualbox.sh +3 -3
- data/templates/CentOS-6.2-x86_64-netboot/zerodisk.sh +3 -0
- data/templates/CentOS-6.3-i386-minimal/definition.rb +2 -1
- data/templates/CentOS-6.3-i386-minimal/vagrant.sh +5 -4
- data/templates/CentOS-6.3-i386-minimal/zerodisk.sh +3 -0
- data/templates/CentOS-6.3-x86_64-minimal/definition.rb +2 -1
- data/templates/CentOS-6.3-x86_64-minimal/vagrant.sh +5 -4
- data/templates/CentOS-6.3-x86_64-minimal/zerodisk.sh +3 -0
- data/templates/Debian-5.0.10-amd64-netboot/base.sh +9 -0
- data/templates/Debian-5.0.10-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-5.0.10-amd64-netboot/cleanup.sh +10 -0
- data/templates/Debian-5.0.10-amd64-netboot/definition.rb +39 -0
- data/templates/Debian-5.0.10-amd64-netboot/postinstall.sh +60 -0
- data/templates/Debian-5.0.10-amd64-netboot/preseed.cfg +312 -0
- data/templates/Debian-5.0.10-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-5.0.10-amd64-netboot/ruby.sh +11 -0
- data/templates/Debian-5.0.10-amd64-netboot/vagrant.sh +14 -0
- data/templates/Debian-5.0.10-amd64-netboot/virtualbox.sh +15 -0
- data/templates/Debian-5.0.10-i386-netboot/base.sh +9 -0
- data/templates/Debian-5.0.10-i386-netboot/chef.sh +2 -0
- data/templates/Debian-5.0.10-i386-netboot/cleanup.sh +10 -0
- data/templates/Debian-5.0.10-i386-netboot/definition.rb +39 -0
- data/templates/Debian-5.0.10-i386-netboot/postinstall.sh +60 -0
- data/templates/Debian-5.0.10-i386-netboot/preseed.cfg +312 -0
- data/templates/Debian-5.0.10-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-5.0.10-i386-netboot/ruby.sh +11 -0
- data/templates/Debian-5.0.10-i386-netboot/vagrant.sh +14 -0
- data/templates/Debian-5.0.10-i386-netboot/virtualbox.sh +15 -0
- data/templates/Debian-5.0.8-amd64-netboot/preseed.cfg +2 -2
- data/templates/Debian-5.0.8-i386-netboot/preseed.cfg +2 -2
- data/templates/Debian-6.0.4-amd64-netboot/definition.rb +1 -1
- data/templates/Debian-6.0.4-amd64-netboot/vagrant.sh +5 -1
- data/templates/Debian-6.0.4-i386-netboot/definition.rb +1 -1
- data/templates/Debian-6.0.4-i386-netboot/vagrant.sh +5 -1
- data/templates/Debian-6.0.5-amd64-netboot/vagrant.sh +5 -1
- data/templates/Debian-6.0.5-i386-netboot/vagrant.sh +5 -1
- data/templates/SLES-11-SP1-DVD-i586-GM/postinstall.sh +3 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/postinstall.sh +3 -0
- data/templates/gentoo-latest-i386-experimental/definition.rb +20 -4
- data/templates/gentoo-latest-x86_64-experimental/definition.rb +23 -12
- data/templates/scientificlinux-6.1-i386-netboot/definition.rb +1 -2
- data/templates/scientificlinux-6.3-i386-netboot/base.sh +1 -0
- data/templates/scientificlinux-6.3-i386-netboot/chef.sh +1 -0
- data/templates/scientificlinux-6.3-i386-netboot/cleanup.sh +4 -0
- data/templates/scientificlinux-6.3-i386-netboot/definition.rb +37 -0
- data/templates/scientificlinux-6.3-i386-netboot/ks.cfg +53 -0
- data/templates/{CentOS-6.0-i386-netboot → scientificlinux-6.3-i386-netboot}/postinstall.sh +2 -2
- data/templates/scientificlinux-6.3-i386-netboot/puppet.sh +1 -0
- data/templates/scientificlinux-6.3-i386-netboot/ruby.sh +1 -0
- data/templates/scientificlinux-6.3-i386-netboot/vagrant.sh +8 -0
- data/templates/scientificlinux-6.3-i386-netboot/virtualbox.sh +8 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/base.sh +1 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/chef.sh +1 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/cleanup.sh +4 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/definition.rb +37 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/ks.cfg +53 -0
- data/templates/{CentOS-6.0-x86_64-netboot → scientificlinux-6.3-x86_64-netboot}/postinstall.sh +2 -2
- data/templates/scientificlinux-6.3-x86_64-netboot/puppet.sh +1 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/ruby.sh +1 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/rvm-ruby.sh +9 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/vagrant.sh +8 -0
- data/templates/scientificlinux-6.3-x86_64-netboot/virtualbox.sh +8 -0
- data/templates/ubuntu-10.04.3-server-i386/postinstall.sh +5 -5
- data/templates/{ubuntu-12.04-server-amd64-packages → ubuntu-12.04.1-server-amd64-packages}/definition.rb +3 -3
- data/templates/{ubuntu-12.04-server-amd64-packages → ubuntu-12.04.1-server-amd64-packages}/postinstall.sh +0 -0
- data/templates/{ubuntu-12.04-server-amd64-packages → ubuntu-12.04.1-server-amd64-packages}/preseed.cfg +0 -0
- data/templates/{ubuntu-12.04-server-amd64 → ubuntu-12.04.1-server-amd64}/definition.rb +3 -3
- data/templates/{ubuntu-12.04-server-amd64 → ubuntu-12.04.1-server-amd64}/postinstall.sh +0 -0
- data/templates/{ubuntu-12.04-server-amd64 → ubuntu-12.04.1-server-amd64}/preseed.cfg +0 -0
- data/templates/{ubuntu-12.04-server-i386-packages → ubuntu-12.04.1-server-i386-packages}/definition.rb +3 -3
- data/templates/{ubuntu-12.04-server-i386-packages → ubuntu-12.04.1-server-i386-packages}/postinstall.sh +0 -0
- data/templates/{ubuntu-12.04-server-i386-packages → ubuntu-12.04.1-server-i386-packages}/preseed.cfg +0 -0
- data/templates/{ubuntu-12.04-server-i386 → ubuntu-12.04.1-server-i386}/definition.rb +3 -3
- data/templates/{ubuntu-12.04-server-i386 → ubuntu-12.04.1-server-i386}/postinstall.sh +0 -0
- data/templates/{ubuntu-12.04-server-i386 → ubuntu-12.04.1-server-i386}/preseed.cfg +0 -0
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/Autounattend.xml +0 -0
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/README.md +0 -0
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/cygwin-setup.exe +0 -0
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/definition.rb +3 -3
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/install-cygwin-sshd.bat +0 -0
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/install-winrm.bat +0 -0
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/oracle-cert.cer +0 -0
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/postinstall.sh +0 -0
- data/templates/{windows-8-preview-dev-amd64 → windows-8-preview-amd64}/winrm.rb +0 -0
- data/validation/veewee.feature +6 -6
- metadata +306 -157
- data/templates/CentOS-6.0-i386/postinstall.sh +0 -48
- data/templates/CentOS-6.0-x86_64-minimal/postinstall.sh +0 -58
- data/templates/CentOS-6.0-x86_64/postinstall.sh +0 -48
- data/templates/CentOS-6.1-x86_64-netboot/postinstall.sh +0 -48
- 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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
-
|
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
data/doc/vagrant.md
CHANGED
@@ -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
|
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
|
data/lib/veewee/command/kvm.rb
CHANGED
@@ -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("-
|
20
|
-
options['
|
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
|
data/lib/veewee/command/vbox.rb
CHANGED
@@ -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:
|
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
|
-
|
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:
|
data/lib/veewee/definition.rb
CHANGED
@@ -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',
|
data/lib/veewee/environment.rb
CHANGED
@@ -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
|
-
|
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
|
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.
|
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
|
-
|
12
|
-
display_port=
|
13
|
-
ui.success "Sending keystrokes to VNC port :#{display_port} - TCP 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.
|
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
|
-
|
18
|
+
@connection.list_volumes.find { |v| v[:name] == "#{name}.img" }
|
19
19
|
end
|
20
20
|
|
21
21
|
def exists_vm?
|
22
|
-
|
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
|
-
|
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
|