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
@@ -42,7 +42,7 @@ module Veewee
|
|
42
42
|
# http://www.libvirt.org/html/libvirt-libvirt.html#virGetVersion
|
43
43
|
# format major * 1,000,000 + minor * 1,000 + release
|
44
44
|
env.logger.info "Checking libvirt version"
|
45
|
-
libvirt_version=conn.
|
45
|
+
libvirt_version=conn.version
|
46
46
|
if libvirt_version < 8003
|
47
47
|
raise Veewee::Error,"You need at least libvirt version 0.8.3 or higher "
|
48
48
|
end
|
@@ -4,41 +4,7 @@ module Veewee
|
|
4
4
|
module BoxCommand
|
5
5
|
|
6
6
|
def validate_parallels(options)
|
7
|
-
|
8
|
-
|
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']="parallels"
|
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]="@parallels"
|
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
|
41
|
-
|
7
|
+
validate_tags([ 'parallels','puppet','chef'],options)
|
42
8
|
end
|
43
9
|
end #Module
|
44
10
|
|
@@ -66,11 +66,11 @@ module Veewee
|
|
66
66
|
|
67
67
|
|
68
68
|
def create_disk
|
69
|
-
ui.info "Creating new harddrive of size #{definition.disk_size.to_i} "
|
69
|
+
ui.info "Creating new harddrive of size #{definition.disk_size.to_i}, format #{definition.disk_format}, variant #{definition.disk_variant} "
|
70
70
|
|
71
71
|
|
72
72
|
place=get_vbox_home
|
73
|
-
command ="#{@vboxcmd} createhd --filename \"#{File.join(place,name,name+"."+definition.disk_format.downcase)}\" --size \"#{definition.disk_size.to_i}\" --format #{definition.disk_format.downcase}"
|
73
|
+
command ="#{@vboxcmd} createhd --filename \"#{File.join(place,name,name+"."+definition.disk_format.downcase)}\" --size \"#{definition.disk_size.to_i}\" --format #{definition.disk_format.downcase} --variant #{definition.disk_variant.downcase}"
|
74
74
|
shell_exec("#{command}")
|
75
75
|
|
76
76
|
end
|
@@ -158,7 +158,7 @@ module Veewee
|
|
158
158
|
if definition.instance_variable_defined?("@#{vm_flag}")
|
159
159
|
vm_flag_value=definition.instance_variable_get("@#{vm_flag}")
|
160
160
|
ui.info "Setting VM Flag #{vm_flag} to #{vm_flag_value}"
|
161
|
-
ui.warn "Used of #{vm_flag} is deprecated - specify your options in :virtualbox => { :
|
161
|
+
ui.warn "Used of #{vm_flag} is deprecated - specify your options in the definition file as \n :virtualbox => { :vm_options => [\"#{vm_flag}\" => \"#{vm_flag_value}\"]}"
|
162
162
|
command="#{@vboxcmd} modifyvm #{name} --#{vm_flag.to_s} #{vm_flag_value}"
|
163
163
|
shell_exec("#{command}")
|
164
164
|
end
|
@@ -3,48 +3,8 @@ module Veewee
|
|
3
3
|
module Virtualbox
|
4
4
|
module BoxCommand
|
5
5
|
|
6
|
-
def validate_vagrant(options)
|
7
|
-
|
8
|
-
unless self.running?
|
9
|
-
ui.error "Error:: You tried to validate box '#{name}' but it is not running"
|
10
|
-
exit -1
|
11
|
-
end
|
12
|
-
|
13
|
-
require 'cucumber'
|
14
|
-
|
15
|
-
require 'cucumber/rspec/disable_option_parser'
|
16
|
-
require 'cucumber/cli/main'
|
17
|
-
|
18
|
-
# Passing ssh options via ENV varialbles to cucumber
|
19
|
-
# VEEWEE_SSH_USER, VEEWEE_SSH_PASSWORD ,VEEWEE_SSH_PORT
|
20
|
-
cucumber_vars=self.ssh_options
|
21
|
-
cucumber_vars.each do |key,value|
|
22
|
-
ENV['VEEWEE_'+key.to_s.upcase]=cucumber_vars[key].to_s
|
23
|
-
end
|
24
|
-
|
25
|
-
# Pass the name of the box
|
26
|
-
ENV['VEEWEE_BOXNAME']=@name
|
27
|
-
ENV['VEEWEE_PROVIDER']="virtualbox"
|
28
|
-
|
29
|
-
feature_path=File.join(File.dirname(__FILE__),"..","..","..","..","..","validation","veewee.feature")
|
30
|
-
|
31
|
-
features=Array.new
|
32
|
-
features[0]=feature_path
|
33
|
-
features[1]="--tags"
|
34
|
-
features[2]="@vagrant,@virtualbox"
|
35
|
-
|
36
|
-
begin
|
37
|
-
# The dup is to keep ARGV intact, so that tools like ruby-debug can respawn.
|
38
|
-
failure = Cucumber::Cli::Main.execute(features.dup)
|
39
|
-
Kernel.exit(failure ? 1 : 0)
|
40
|
-
rescue SystemExit => e
|
41
|
-
Kernel.exit(e.status)
|
42
|
-
rescue Exception => e
|
43
|
-
ui.error("#{e.message} (#{e.class})")
|
44
|
-
ui.error(e.backtrace.join("\n"))
|
45
|
-
Kernel.exit(1)
|
46
|
-
end
|
47
|
-
|
6
|
+
def validate_vagrant(options = {})
|
7
|
+
validate_tags( options['tags'],options)
|
48
8
|
end
|
49
9
|
end #Module
|
50
10
|
|
@@ -6,7 +6,7 @@ module Veewee
|
|
6
6
|
def build_info
|
7
7
|
info=super
|
8
8
|
output=IO.popen("#{vmrun_cmd.shellescape}").readlines
|
9
|
-
info << {:filename => ".vmfusion_version",:content =>
|
9
|
+
info << {:filename => ".vmfusion_version",:content => @provider.fusion_version }
|
10
10
|
end
|
11
11
|
|
12
12
|
|
@@ -14,7 +14,7 @@ module Veewee
|
|
14
14
|
# use vmware fusion 3.x as default path
|
15
15
|
iso_images_dir="/Library/Application Support/VMware Fusion/isoimages"
|
16
16
|
|
17
|
-
# if path doesn't exist check for vmware fusion 4.x path
|
17
|
+
# if path doesn't exist check for vmware fusion >= 4.x path
|
18
18
|
if( ! File.exists?(iso_images_dir) )
|
19
19
|
iso_images_dir="/Applications/VMware Fusion.app/Contents/Library/isoimages"
|
20
20
|
end
|
@@ -42,7 +42,11 @@ module Veewee
|
|
42
42
|
|
43
43
|
env.logger.info "About to transfer vmware tools iso buildinfo to the box #{name} - #{ip_address} - #{ssh_options}"
|
44
44
|
iso_image=guest_iso_path
|
45
|
-
|
45
|
+
if File.exists?(iso_image)
|
46
|
+
self.scp(iso_image,File.basename(iso_image))
|
47
|
+
else
|
48
|
+
raise Veewee::Error, "We could not find the file #{iso_image}. In newer versions of Fusion, you might have to download the Guest Additions yourself. You can do this by first manually creating a vm and than 'installing the guest additions'"
|
49
|
+
end
|
46
50
|
end
|
47
51
|
|
48
52
|
end
|
@@ -18,10 +18,19 @@ module Veewee
|
|
18
18
|
floppy_path=File.join(definition.path,'virtualfloppy.img')
|
19
19
|
end
|
20
20
|
|
21
|
+
# Depending on the fusion version, we need to update the virtualhw version
|
22
|
+
if @provider.fusion_version.start_with?('5.')
|
23
|
+
virtualhw_version = 9
|
24
|
+
else
|
25
|
+
virtualhw_version = 7
|
26
|
+
end
|
27
|
+
|
28
|
+
# Setup the variables for in the erb template
|
21
29
|
data = {
|
22
30
|
:cpu_count => definition.cpu_count, :memory_size => definition.memory_size,
|
23
31
|
:controller_type => "lsilogic",
|
24
32
|
:fusion_os_type => definition.os_type_id,
|
33
|
+
:virtualhw_version => virtualhw_version,
|
25
34
|
:floppyfile => floppy_path,
|
26
35
|
:mac_addres => "auto generated",
|
27
36
|
:iso_file => "#{File.join(env.config.veewee.iso_dir,definition.iso_file)}",
|
@@ -4,41 +4,7 @@ module Veewee
|
|
4
4
|
module BoxCommand
|
5
5
|
|
6
6
|
def validate_vmfusion(options)
|
7
|
-
|
8
|
-
|
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']="vmfusion"
|
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]="@vmfusion"
|
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
|
-
env.ui.error("#{e.message} (#{e.class})")
|
38
|
-
env.ui.error(e.backtrace.join("\n"))
|
39
|
-
Kernel.exit(1)
|
40
|
-
end
|
41
|
-
|
7
|
+
validate_tags( options['tags'],options)
|
42
8
|
end
|
43
9
|
end #Module
|
44
10
|
|
@@ -8,24 +8,28 @@ module Veewee
|
|
8
8
|
#include ::Veewee::Provider::Vmfusion::ProviderCommand
|
9
9
|
|
10
10
|
def check_requirements
|
11
|
-
fusion_version = :unknown
|
12
|
-
|
13
11
|
require 'fission'
|
12
|
+
|
14
13
|
if File.exists?("/Library/Application Support/VMware Fusion/vmrun")
|
15
|
-
fusion_version = "3.x"
|
16
14
|
::Fission.config.attributes["vmrun_bin"] = "/Library/Application Support/VMware Fusion/vmrun"
|
17
|
-
|
18
|
-
|
19
|
-
if File.exists?("/Applications/VMware Fusion.app/Contents/Library/vmrun")
|
20
|
-
fusion_version = "4.x"
|
15
|
+
elsif File.exists?("/Applications/VMware Fusion.app/Contents/Library/vmrun")
|
21
16
|
::Fission.config.attributes["vmrun_bin"] = "/Applications/VMware Fusion.app/Contents/Library/vmrun"
|
22
|
-
|
23
|
-
|
24
|
-
if fusion_version == :unknown
|
17
|
+
elsif
|
25
18
|
raise Veewee::Error,"Could not find vmrun at standard locations. Probably you don't have Vmware fusion installed"
|
26
19
|
end
|
20
|
+
env.logger.info("Found fusion version: #{fusion_version}")
|
27
21
|
end
|
28
22
|
|
23
|
+
def fusion_version
|
24
|
+
# We ask the system profiler for all installed software
|
25
|
+
shell_results = shell_exec("system_profiler SPApplicationsDataType")
|
26
|
+
|
27
|
+
env.logger.info("Checking version by querying the system_profiler")
|
28
|
+
env.logger.debug(shell_results.stdout)
|
29
|
+
|
30
|
+
version = shell_results.stdout.split(/VMware/)[1].split(/\n/)[2].split(/:/)[1].strip
|
31
|
+
return version
|
32
|
+
end
|
29
33
|
|
30
34
|
end #End Class
|
31
35
|
end # End Module
|
data/lib/veewee/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Base install
|
2
|
+
|
3
|
+
sed -i "s/^.*requiretty/#Defaults requiretty/" /etc/sudoers
|
4
|
+
|
5
|
+
cat > /etc/yum.repos.d/epel.repo << EOM
|
6
|
+
[epel]
|
7
|
+
name=epel
|
8
|
+
baseurl=http://download.fedoraproject.org/pub/epel/6/\$basearch
|
9
|
+
enabled=1
|
10
|
+
gpgcheck=0
|
11
|
+
EOM
|
12
|
+
|
13
|
+
yum -y install gcc make gcc-c++ kernel-devel-`uname -r` zlib-devel openssl-devel readline-devel sqlite-devel perl wget
|
14
|
+
|
@@ -1,16 +1,40 @@
|
|
1
|
-
Veewee::
|
2
|
-
:cpu_count => '1',
|
3
|
-
:
|
4
|
-
:
|
1
|
+
Veewee::Session.declare({
|
2
|
+
:cpu_count => '1',
|
3
|
+
:memory_size=> '480',
|
4
|
+
:disk_size => '10140',
|
5
|
+
:disk_format => 'VDI',
|
6
|
+
:hostiocache => 'off',
|
7
|
+
:os_type_id => 'RedHat_64',
|
5
8
|
:iso_file => "CentOS-6.0-i386-netinstall.iso",
|
6
9
|
:iso_src => "http://vault.centos.org/6.0/isos/i386/CentOS-6.0-i386-netinstall.iso",
|
7
10
|
:iso_md5 => "65731c29c49630dea6cde103d02ccffb",
|
8
11
|
:iso_download_timeout => 1000,
|
9
|
-
:boot_wait => "15",
|
10
|
-
:
|
11
|
-
|
12
|
-
|
12
|
+
:boot_wait => "15",
|
13
|
+
:boot_cmd_sequence => [
|
14
|
+
'<Tab> text ks=http://%IP%:%PORT%/ks.cfg<Enter>'
|
15
|
+
],
|
16
|
+
:kickstart_port => "7122",
|
17
|
+
:kickstart_timeout => 10000,
|
18
|
+
:kickstart_file => "ks.cfg",
|
19
|
+
:ssh_login_timeout => "10000",
|
20
|
+
:ssh_user => "veewee",
|
21
|
+
:ssh_password => "veewee",
|
22
|
+
:ssh_key => "",
|
23
|
+
:ssh_host_port => "7222",
|
24
|
+
:ssh_guest_port => "22",
|
13
25
|
:sudo_cmd => "echo '%p'|sudo -S sh '%f'",
|
14
26
|
:shutdown_cmd => "/sbin/halt -h -p",
|
15
|
-
:postinstall_files => [
|
27
|
+
:postinstall_files => [
|
28
|
+
"base.sh",
|
29
|
+
"ruby.sh",
|
30
|
+
"chef.sh",
|
31
|
+
"puppet.sh",
|
32
|
+
"vagrant.sh",
|
33
|
+
"virtualbox.sh",
|
34
|
+
#"kvm.sh",
|
35
|
+
#"vmfusion.sh",
|
36
|
+
"cleanup.sh",
|
37
|
+
"zerodisk.sh"
|
38
|
+
],
|
39
|
+
:postinstall_timeout => 10000
|
16
40
|
})
|
@@ -1,13 +1,13 @@
|
|
1
1
|
install
|
2
|
-
url --url=http://
|
2
|
+
url --url=http://vault.centos.org/6.0/os/i386/
|
3
3
|
lang en_US.UTF-8
|
4
4
|
keyboard us
|
5
|
-
network --bootproto
|
5
|
+
network --bootproto=dhcp
|
6
6
|
rootpw --iscrypted $1$damlkd,f$UC/u5pUts5QiU3ow.CSso/
|
7
|
-
firewall --enabled --
|
8
|
-
authconfig --enableshadow --
|
7
|
+
firewall --enabled --service=ssh
|
8
|
+
authconfig --enableshadow --passalgo=sha512
|
9
9
|
selinux --disabled
|
10
|
-
timezone
|
10
|
+
timezone UTC
|
11
11
|
bootloader --location=mbr
|
12
12
|
|
13
13
|
text
|
@@ -17,37 +17,26 @@ zerombr
|
|
17
17
|
clearpart --all --initlabel
|
18
18
|
autopart
|
19
19
|
|
20
|
-
auth
|
20
|
+
auth --useshadow --enablemd5
|
21
21
|
firstboot --disabled
|
22
22
|
reboot
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
%packages
|
28
|
-
@ core
|
29
|
-
ruby
|
30
|
-
ruby-devel
|
31
|
-
rubygems
|
32
|
-
kernel-devel
|
33
|
-
gcc
|
34
|
-
gcc-c++
|
24
|
+
%packages --ignoremissing
|
25
|
+
@core
|
35
26
|
bzip2
|
36
|
-
|
37
|
-
|
38
|
-
openssl-devel
|
39
|
-
readline-devel
|
40
|
-
sqlite-devel
|
41
|
-
puppet
|
42
|
-
facter
|
43
|
-
|
27
|
+
kernel-devel
|
28
|
+
kernel-headers
|
44
29
|
-ipw2100-firmware
|
45
30
|
-ipw2200-firmware
|
46
31
|
-ivtv-firmware
|
32
|
+
%end
|
47
33
|
|
48
34
|
%post
|
49
|
-
/usr/
|
50
|
-
/usr/sbin/
|
51
|
-
|
52
|
-
echo "
|
53
|
-
|
35
|
+
/usr/bin/yum -y install sudo
|
36
|
+
/usr/sbin/groupadd veewee
|
37
|
+
/usr/sbin/useradd veewee -g veewee -G wheel
|
38
|
+
echo "veewee"|passwd --stdin veewee
|
39
|
+
echo "veewee ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/veewee
|
40
|
+
chmod 0440 /etc/sudoers.d/veewee
|
41
|
+
%end
|
42
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Vagrant specific
|
2
|
+
date > /etc/vagrant_box_build_time
|
3
|
+
|
4
|
+
# Add vagrant user
|
5
|
+
/usr/sbin/groupadd vagrant
|
6
|
+
/usr/sbin/useradd vagrant -g vagrant -G wheel
|
7
|
+
echo "vagrant"|passwd --stdin vagrant
|
8
|
+
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/vagrant
|
9
|
+
chmod 0440 /etc/sudoers.d/vagrant
|
10
|
+
|
11
|
+
# Installing vagrant keys
|
12
|
+
mkdir -pm 700 /home/vagrant/.ssh
|
13
|
+
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
|
14
|
+
chmod 0600 /home/vagrant/.ssh/authorized_keys
|
15
|
+
chown -R vagrant /home/vagrant/.ssh
|
16
|
+
|
17
|
+
# Customize the message of the day
|
18
|
+
echo 'Welcome to your Vagrant-built virtual machine.' > /etc/motd
|