veewee 0.3.0.alpha4 → 0.3.0.alpha5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.rvmrc +3 -2
- data/Gemfile +1 -1
- data/License +1 -1
- data/README.md +30 -174
- data/Rakefile +4 -2
- data/doc/README-changes.txt +19 -0
- data/doc/TODO +60 -0
- data/doc/definition.md +58 -0
- data/doc/fusion.md +2 -0
- data/doc/install.md +16 -0
- data/doc/installation.md +24 -0
- data/doc/kvm.md +2 -0
- data/doc/providers.md +23 -0
- data/doc/requirements.md +1 -0
- data/doc/running.md +83 -0
- data/doc/template.md +102 -0
- data/doc/vagrant.md +119 -0
- data/doc/vbox.md +2 -0
- data/lib/net/vnc/vnc.rb +1 -1
- data/lib/python/parallels_sdk_check.py +19 -0
- data/lib/python/parallels_send_key.py +73 -0
- data/lib/veewee/command.rb +2 -1
- data/lib/veewee/command/kvm.rb +55 -15
- data/lib/veewee/command/parallels.rb +124 -0
- data/lib/veewee/command/vagrant.rb +2 -106
- data/lib/veewee/command/vagrant/basebox.rb +82 -0
- data/lib/veewee/command/vagrant/build.rb +64 -0
- data/lib/veewee/command/vagrant/define.rb +48 -0
- data/lib/veewee/command/vagrant/destroy.rb +47 -0
- data/lib/veewee/command/vagrant/export.rb +44 -0
- data/lib/veewee/command/vagrant/halt.rb +43 -0
- data/lib/veewee/command/vagrant/list.rb +38 -0
- data/lib/veewee/command/vagrant/ostypes.rb +38 -0
- data/lib/veewee/command/vagrant/ssh.rb +39 -0
- data/lib/veewee/command/vagrant/templates.rb +39 -0
- data/lib/veewee/command/vagrant/undefine.rb +41 -0
- data/lib/veewee/command/vagrant/up.rb +44 -0
- data/lib/veewee/command/virtualbox.rb +61 -14
- data/lib/veewee/command/vmfusion.rb +44 -21
- data/lib/veewee/config.rb +0 -27
- data/lib/veewee/config/ostypes.yml +179 -43
- data/lib/veewee/config/vmfusion-ostypes.txt +1 -0
- data/lib/veewee/definition.rb +91 -35
- data/lib/veewee/definitions.rb +156 -0
- data/lib/veewee/environment.rb +80 -244
- data/lib/veewee/error.rb +12 -0
- data/lib/veewee/provider/core/box.rb +52 -0
- data/lib/veewee/provider/core/box/build.rb +229 -0
- data/lib/veewee/provider/core/box/exec.rb +34 -0
- data/lib/veewee/provider/core/box/floppy.rb +31 -0
- data/lib/veewee/provider/core/box/halt.rb +24 -0
- data/lib/veewee/provider/core/box/issh.rb +15 -0
- data/lib/veewee/provider/core/box/poweroff.rb +12 -0
- data/lib/veewee/provider/core/box/scp.rb +29 -0
- data/lib/veewee/provider/core/box/ssh.rb +95 -0
- data/lib/veewee/provider/core/box/sudo.rb +21 -0
- data/lib/veewee/{builder → provider}/core/box/vnc.rb +4 -4
- data/lib/veewee/provider/core/helper/iso.rb +142 -0
- data/lib/veewee/provider/core/helper/scancode.rb +114 -0
- data/lib/veewee/provider/core/helper/shell.rb +55 -0
- data/lib/veewee/provider/core/helper/ssh.rb +162 -0
- data/lib/veewee/provider/core/helper/tcp.rb +96 -0
- data/lib/veewee/provider/core/helper/web.rb +67 -0
- data/lib/veewee/{builder/core/builder.rb → provider/core/provider.rb} +8 -25
- data/lib/veewee/{builder/core/builder → provider/core/provider}/transaction.rb +0 -0
- data/lib/veewee/{builder/core/builder → provider/core/provider}/tunnel.rb +2 -2
- data/lib/veewee/provider/kvm/box.rb +46 -0
- data/lib/veewee/provider/kvm/box/build.rb +11 -0
- data/lib/veewee/provider/kvm/box/create.rb +76 -0
- data/lib/veewee/provider/kvm/box/destroy.rb +33 -0
- data/lib/veewee/provider/kvm/box/halt.rb +19 -0
- data/lib/veewee/provider/kvm/box/helper/console_type.rb +20 -0
- data/lib/veewee/provider/kvm/box/helper/ip.rb +14 -0
- data/lib/veewee/provider/kvm/box/helper/ssh_options.rb +19 -0
- data/lib/veewee/provider/kvm/box/helper/status.rb +28 -0
- data/lib/veewee/provider/kvm/box/poweroff.rb +14 -0
- data/lib/veewee/provider/kvm/box/up.rb +14 -0
- data/lib/veewee/provider/kvm/box/validate_kvm.rb +47 -0
- data/lib/veewee/provider/kvm/provider.rb +70 -0
- data/lib/veewee/provider/parallels/box.rb +35 -0
- data/lib/veewee/provider/parallels/box/build.rb +13 -0
- data/lib/veewee/provider/parallels/box/create.rb +63 -0
- data/lib/veewee/provider/parallels/box/destroy.rb +24 -0
- data/lib/veewee/provider/parallels/box/halt.rb +14 -0
- data/lib/veewee/provider/parallels/box/helper/buildinfo.rb +45 -0
- data/lib/veewee/provider/parallels/box/helper/console_type.rb +198 -0
- data/lib/veewee/provider/parallels/box/helper/ip.rb +23 -0
- data/lib/veewee/provider/parallels/box/helper/ssh_options.rb +20 -0
- data/lib/veewee/provider/parallels/box/helper/status.rb +28 -0
- data/lib/veewee/provider/parallels/box/poweroff.rb +14 -0
- data/lib/veewee/provider/parallels/box/ssh.rb +12 -0
- data/lib/veewee/provider/parallels/box/up.rb +15 -0
- data/lib/veewee/provider/parallels/box/validate_parallels.rb +47 -0
- data/lib/veewee/provider/parallels/notes/parallels-sdk.txt +116 -0
- data/lib/veewee/provider/parallels/provider.rb +33 -0
- data/lib/veewee/provider/virtualbox/box.rb +46 -0
- data/lib/veewee/provider/virtualbox/box/build.rb +20 -0
- data/lib/veewee/provider/virtualbox/box/create.rb +58 -0
- data/lib/veewee/provider/virtualbox/box/destroy.rb +66 -0
- data/lib/veewee/provider/virtualbox/box/export_vagrant.rb +99 -0
- data/lib/veewee/provider/virtualbox/box/halt.rb +13 -0
- data/lib/veewee/provider/virtualbox/box/helper/buildinfo.rb +25 -0
- data/lib/veewee/provider/virtualbox/box/helper/console_type.rb +62 -0
- data/lib/veewee/provider/virtualbox/box/helper/create.rb +176 -0
- data/lib/veewee/provider/virtualbox/box/helper/forwarding.rb +38 -0
- data/lib/veewee/provider/virtualbox/box/helper/guest_additions.rb +17 -0
- data/lib/veewee/provider/virtualbox/box/helper/ip.rb +19 -0
- data/lib/veewee/provider/virtualbox/box/helper/natinterface.rb +17 -0
- data/lib/veewee/provider/virtualbox/box/helper/ssh_options.rb +28 -0
- data/lib/veewee/provider/virtualbox/box/helper/status.rb +27 -0
- data/lib/veewee/provider/virtualbox/box/helper/version.rb +18 -0
- data/lib/veewee/provider/virtualbox/box/poweroff.rb +19 -0
- data/lib/veewee/provider/virtualbox/box/ssh.rb +13 -0
- data/lib/veewee/provider/virtualbox/box/up.rb +48 -0
- data/lib/veewee/provider/virtualbox/box/validate_vagrant.rb +53 -0
- data/lib/veewee/provider/virtualbox/provider.rb +19 -0
- data/lib/veewee/provider/vmfusion/box.rb +67 -0
- data/lib/veewee/provider/vmfusion/box/build.rb +13 -0
- data/lib/veewee/{builder/vmfusion/helper → provider/vmfusion/box}/create.rb +15 -24
- data/lib/veewee/provider/vmfusion/box/destroy.rb +20 -0
- data/lib/veewee/provider/vmfusion/box/export_ova.rb +49 -0
- data/lib/veewee/provider/vmfusion/box/halt.rb +13 -0
- data/lib/veewee/provider/vmfusion/box/helper/buildinfo.rb +43 -0
- data/lib/veewee/provider/vmfusion/box/helper/console_type.rb +18 -0
- data/lib/veewee/provider/vmfusion/box/helper/ip.rb +19 -0
- data/lib/veewee/provider/vmfusion/box/helper/ssh_options.rb +20 -0
- data/lib/veewee/provider/vmfusion/box/helper/status.rb +20 -0
- data/lib/veewee/provider/vmfusion/box/helper/vnc.rb +61 -0
- data/lib/veewee/provider/vmfusion/box/poweroff.rb +13 -0
- data/lib/veewee/provider/vmfusion/box/ssh.rb +12 -0
- data/lib/veewee/{builder/vmfusion/helper → provider/vmfusion/box}/template.rb +9 -4
- data/lib/veewee/{builder/vmfusion/helper → provider/vmfusion/box}/template.vmx.erb +5 -2
- data/lib/veewee/provider/vmfusion/box/up.rb +18 -0
- data/lib/veewee/provider/vmfusion/box/validate_vmfusion.rb +47 -0
- data/lib/veewee/{builder → provider}/vmfusion/info/export_ovf.info +0 -0
- data/lib/veewee/provider/vmfusion/provider.rb +20 -0
- data/lib/veewee/providers.rb +31 -0
- data/lib/veewee/template.rb +26 -0
- data/lib/veewee/templates.rb +71 -0
- data/lib/veewee/ui.rb +6 -4
- data/lib/veewee/version.rb +1 -1
- data/templates/CentOS-4.8-i386/postinstall.sh +1 -1
- data/templates/CentOS-5.5-i386-netboot/definition.rb +16 -0
- data/templates/CentOS-5.5-i386-netboot/ks.cfg +46 -0
- data/templates/CentOS-5.5-i386-netboot/postinstall.sh +60 -0
- data/templates/CentOS-5.5-x86_64-netboot/definition.rb +1 -1
- data/templates/CentOS-5.5-x86_64-netboot/postinstall.sh +1 -1
- data/templates/CentOS-5.6-i386-netboot/definition.rb +1 -1
- data/templates/CentOS-5.6-i386-netboot/ks.cfg +2 -2
- data/templates/CentOS-5.6-i386-netboot/postinstall.sh +21 -9
- data/templates/CentOS-5.6-i386/postinstall.sh +1 -1
- data/templates/CentOS-5.6-x86_64-netboot/definition.rb +1 -1
- data/templates/CentOS-5.6-x86_64-netboot/ks.cfg +1 -1
- data/templates/CentOS-5.6-x86_64-netboot/postinstall.sh +1 -1
- data/templates/CentOS-5.7-i386-netboot/postinstall.sh +3 -3
- data/templates/CentOS-5.7-x86_64-netboot/postinstall.sh +1 -1
- data/templates/CentOS-6.0-i386-netboot/ks.cfg +3 -2
- data/templates/CentOS-6.0-i386-netboot/postinstall.sh +1 -1
- data/templates/CentOS-6.0-i386/ks.cfg +2 -1
- data/templates/CentOS-6.0-i386/postinstall.sh +1 -1
- data/templates/CentOS-6.0-x86_64-minimal/definition.rb +2 -2
- data/templates/CentOS-6.0-x86_64-minimal/ks.cfg +2 -1
- data/templates/CentOS-6.0-x86_64-minimal/postinstall.sh +17 -4
- data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +4 -2
- data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +1 -1
- data/templates/CentOS-6.0-x86_64/base.sh +12 -0
- data/templates/CentOS-6.0-x86_64/chef.sh +2 -0
- data/templates/CentOS-6.0-x86_64/cleanup.sh +4 -0
- data/templates/CentOS-6.0-x86_64/definition.rb +22 -8
- data/templates/CentOS-6.0-x86_64/ks.cfg +2 -1
- data/templates/CentOS-6.0-x86_64/postinstall.sh +1 -1
- data/templates/CentOS-6.0-x86_64/puppet.sh +11 -0
- data/templates/CentOS-6.0-x86_64/ruby.sh +2 -0
- data/templates/CentOS-6.0-x86_64/vagrant.sh +9 -0
- data/templates/CentOS-6.0-x86_64/virtualbox.sh +8 -0
- data/templates/CentOS-6.1-x86_64-minimal/base.sh +13 -0
- data/templates/CentOS-6.1-x86_64-minimal/chef.sh +2 -0
- data/templates/CentOS-6.1-x86_64-minimal/cleanup.sh +4 -0
- data/templates/CentOS-6.1-x86_64-minimal/definition.rb +39 -0
- data/templates/CentOS-6.1-x86_64-minimal/ks.cfg +47 -0
- data/templates/CentOS-6.1-x86_64-minimal/puppet.sh +11 -0
- data/templates/CentOS-6.1-x86_64-minimal/ruby.sh +2 -0
- data/templates/CentOS-6.1-x86_64-minimal/vagrant.sh +16 -0
- data/templates/CentOS-6.1-x86_64-minimal/virtualbox.sh +8 -0
- data/templates/CentOS-6.1-x86_64-netboot/base.sh +13 -0
- data/templates/CentOS-6.1-x86_64-netboot/chef.sh +2 -0
- data/templates/CentOS-6.1-x86_64-netboot/cleanup.sh +4 -0
- data/templates/CentOS-6.1-x86_64-netboot/definition.rb +39 -0
- data/templates/CentOS-6.1-x86_64-netboot/ks.cfg +46 -0
- data/templates/CentOS-6.1-x86_64-netboot/postinstall.sh +48 -0
- data/templates/CentOS-6.1-x86_64-netboot/puppet.sh +11 -0
- data/templates/CentOS-6.1-x86_64-netboot/ruby.sh +2 -0
- data/templates/CentOS-6.1-x86_64-netboot/vagrant.sh +16 -0
- data/templates/CentOS-6.1-x86_64-netboot/virtualbox.sh +8 -0
- data/templates/CentOS-6.2-x86_64-minimal/base.sh +14 -0
- data/templates/CentOS-6.2-x86_64-minimal/chef.sh +3 -0
- data/templates/CentOS-6.2-x86_64-minimal/cleanup.sh +5 -0
- data/templates/CentOS-6.2-x86_64-minimal/definition.rb +39 -0
- data/templates/CentOS-6.2-x86_64-minimal/ks.cfg +39 -0
- data/templates/CentOS-6.2-x86_64-minimal/puppet.sh +12 -0
- data/templates/CentOS-6.2-x86_64-minimal/ruby.sh +3 -0
- data/templates/CentOS-6.2-x86_64-minimal/vagrant.sh +17 -0
- data/templates/CentOS-6.2-x86_64-minimal/virtualbox.sh +8 -0
- data/templates/CentOS-6.2-x86_64-netboot/base.sh +13 -0
- data/templates/CentOS-6.2-x86_64-netboot/chef.sh +2 -0
- data/templates/CentOS-6.2-x86_64-netboot/cleanup.sh +4 -0
- data/templates/CentOS-6.2-x86_64-netboot/definition.rb +39 -0
- data/templates/CentOS-6.2-x86_64-netboot/ks.cfg +46 -0
- data/templates/CentOS-6.2-x86_64-netboot/postinstall.sh +48 -0
- data/templates/CentOS-6.2-x86_64-netboot/puppet.sh +11 -0
- data/templates/CentOS-6.2-x86_64-netboot/ruby.sh +2 -0
- data/templates/CentOS-6.2-x86_64-netboot/vagrant.sh +16 -0
- data/templates/CentOS-6.2-x86_64-netboot/virtualbox.sh +8 -0
- data/templates/Debian-5.0.8-amd64-netboot/base.sh +9 -0
- data/templates/Debian-5.0.8-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-5.0.8-amd64-netboot/cleanup.sh +10 -0
- data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +1 -1
- data/templates/Debian-5.0.8-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-5.0.8-amd64-netboot/ruby.sh +11 -0
- data/templates/Debian-5.0.8-amd64-netboot/vagrant.sh +14 -0
- data/templates/Debian-5.0.8-amd64-netboot/virtualbox.sh +15 -0
- data/templates/Debian-5.0.8-i386-netboot/base.sh +9 -0
- data/templates/Debian-5.0.8-i386-netboot/chef.sh +2 -0
- data/templates/Debian-5.0.8-i386-netboot/cleanup.sh +10 -0
- data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +1 -1
- data/templates/Debian-5.0.8-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-5.0.8-i386-netboot/ruby.sh +11 -0
- data/templates/Debian-5.0.8-i386-netboot/vagrant.sh +14 -0
- data/templates/Debian-5.0.8-i386-netboot/virtualbox.sh +15 -0
- data/templates/Debian-6.0.3-amd64-netboot/base.sh +13 -0
- data/templates/Debian-6.0.3-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.3-amd64-netboot/cleanup-virtualbox.sh +2 -0
- data/templates/Debian-6.0.3-amd64-netboot/cleanup.sh +18 -0
- data/templates/{Debian-6.0.2-amd64-netboot → Debian-6.0.3-amd64-netboot}/definition.rb +5 -4
- data/templates/Debian-6.0.3-amd64-netboot/postinstall.sh +80 -0
- data/templates/{Debian-6.0.2-amd64-netboot → Debian-6.0.3-amd64-netboot}/preseed.cfg +0 -0
- data/templates/Debian-6.0.3-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.3-amd64-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.3-amd64-netboot/vagrant.sh +25 -0
- data/templates/Debian-6.0.3-amd64-netboot/virtualbox.sh +15 -0
- data/templates/Debian-6.0.3-amd64-netboot/zerodisk.sh +3 -0
- data/templates/Debian-6.0.3-i386-netboot/base.sh +13 -0
- data/templates/Debian-6.0.3-i386-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.3-i386-netboot/cleanup-virtualbox.sh +2 -0
- data/templates/Debian-6.0.3-i386-netboot/cleanup.sh +18 -0
- data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/definition.rb +3 -3
- data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/postinstall.sh +1 -4
- data/templates/{Debian-6.0.2-i386-netboot → Debian-6.0.3-i386-netboot}/preseed.cfg +0 -0
- data/templates/Debian-6.0.3-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.3-i386-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.3-i386-netboot/vagrant.sh +25 -0
- data/templates/Debian-6.0.3-i386-netboot/virtualbox.sh +15 -0
- data/templates/Debian-6.0.3-i386-netboot/zerodisk.sh +3 -0
- data/templates/Debian-6.0.4-amd64-netboot/base.sh +13 -0
- data/templates/Debian-6.0.4-amd64-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.4-amd64-netboot/cleanup-virtualbox.sh +4 -0
- data/templates/Debian-6.0.4-amd64-netboot/cleanup.sh +17 -0
- data/templates/Debian-6.0.4-amd64-netboot/definition.rb +49 -0
- data/templates/Debian-6.0.4-amd64-netboot/preseed.cfg +315 -0
- data/templates/Debian-6.0.4-amd64-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.4-amd64-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.4-amd64-netboot/vagrant.sh +21 -0
- data/templates/Debian-6.0.4-amd64-netboot/virtualbox.sh +13 -0
- data/templates/Debian-6.0.4-amd64-netboot/zerodisk.sh +3 -0
- data/templates/Debian-6.0.4-i386-netboot/base.sh +13 -0
- data/templates/Debian-6.0.4-i386-netboot/chef.sh +2 -0
- data/templates/Debian-6.0.4-i386-netboot/cleanup-virtualbox.sh +4 -0
- data/templates/Debian-6.0.4-i386-netboot/cleanup.sh +17 -0
- data/templates/Debian-6.0.4-i386-netboot/definition.rb +51 -0
- data/templates/Debian-6.0.4-i386-netboot/preseed.cfg +315 -0
- data/templates/Debian-6.0.4-i386-netboot/puppet.sh +2 -0
- data/templates/Debian-6.0.4-i386-netboot/ruby.sh +10 -0
- data/templates/Debian-6.0.4-i386-netboot/vagrant.sh +21 -0
- data/templates/Debian-6.0.4-i386-netboot/virtualbox.sh +13 -0
- data/templates/Debian-6.0.4-i386-netboot/zerodisk.sh +3 -0
- data/templates/Fedora-14-amd64-netboot/postinstall.sh +1 -1
- data/templates/Fedora-14-amd64/postinstall.sh +1 -1
- data/templates/Fedora-14-i386-netboot/postinstall.sh +1 -1
- data/templates/Fedora-14-i386/postinstall.sh +1 -1
- data/templates/Fedora-15-x86_64-netboot/definition.rb +29 -0
- data/templates/Fedora-15-x86_64-netboot/ks.cfg +64 -0
- data/templates/Fedora-15-x86_64-netboot/postinstall.sh +33 -0
- data/templates/Fedora-16-i386/definition.rb +17 -0
- data/templates/Fedora-16-i386/ks.cfg +72 -0
- data/templates/Fedora-16-i386/postinstall.sh +35 -0
- data/templates/Fedora-16-x86_64/definition.rb +17 -0
- data/templates/Fedora-16-x86_64/ks.cfg +72 -0
- data/templates/Fedora-16-x86_64/postinstall.sh +35 -0
- data/templates/SLES-11-SP1-DVD-i586-GM/autoinst_de.xml +1127 -0
- data/templates/SLES-11-SP1-DVD-i586-GM/autoinst_en.xml +1127 -0
- data/templates/SLES-11-SP1-DVD-i586-GM/definition.rb +37 -0
- data/templates/SLES-11-SP1-DVD-i586-GM/postinstall.sh +43 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/autoinst_de.xml +1171 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/autoinst_en.xml +1171 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/definition.rb +37 -0
- data/templates/SLES-11-SP1-DVD-x86_64-GM/postinstall.sh +43 -0
- data/templates/archlinux-i386-netboot/aif.cfg +8 -14
- data/templates/archlinux-i386-netboot/definition.rb +4 -7
- data/templates/archlinux-i386-netboot/postinstall.sh +5 -17
- data/templates/archlinux-i386-netboot/postinstall2.sh +3 -1
- data/templates/archlinux-i386/postinstall.sh +1 -1
- data/templates/archlinux-x86_64-netboot/aif.cfg +8 -14
- data/templates/archlinux-x86_64-netboot/definition.rb +4 -7
- data/templates/archlinux-x86_64-netboot/postinstall.sh +1 -16
- data/templates/archlinux-x86_64-netboot/postinstall2.sh +3 -1
- data/templates/archlinux-x86_64/postinstall.sh +1 -1
- data/templates/freebsd-8.2-pcbsd-i386-netboot/definition.rb +5 -3
- data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +1 -1
- data/templates/freebsd-8.2-pcbsd-i386/definition.rb +3 -2
- data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +1 -1
- data/templates/funtoo-latest-generic_64-stable/definition.rb +34 -0
- data/templates/funtoo-latest-generic_64-stable/postinstall.sh +177 -0
- data/templates/funtoo-latest-generic_64-stable/postinstall2.sh +83 -0
- data/templates/gentoo-latest-i386-experimental/definition.rb +6 -6
- data/templates/gentoo-latest-i386-experimental/postinstall.sh +1 -1
- data/templates/gentoo-latest-x86_64-experimental/definition.rb +34 -0
- data/templates/gentoo-latest-x86_64-experimental/postinstall.sh +214 -0
- data/templates/openSUSE-11.4-DVD-i586/postinstall.sh +6 -1
- data/templates/openSUSE-11.4-DVD-x86_64/postinstall.sh +6 -1
- data/templates/openSUSE-11.4-NET-i586/postinstall.sh +6 -1
- data/templates/openSUSE-11.4-NET-x86_64/postinstall.sh +6 -1
- data/templates/openSUSE-12.1-DVD+NET-i586/autoinst_de.xml +1483 -0
- data/templates/openSUSE-12.1-DVD+NET-i586/autoinst_en.xml +1483 -0
- data/templates/openSUSE-12.1-DVD+NET-i586/definition.rb +44 -0
- data/templates/openSUSE-12.1-DVD+NET-i586/postinstall.sh +48 -0
- data/templates/openSUSE-12.1-DVD+NET-x86_64/autoinst_de.xml +1727 -0
- data/templates/openSUSE-12.1-DVD+NET-x86_64/autoinst_en.xml +1727 -0
- data/templates/openSUSE-12.1-DVD+NET-x86_64/definition.rb +44 -0
- data/templates/openSUSE-12.1-DVD+NET-x86_64/postinstall.sh +48 -0
- data/templates/openbsd50_amd64/README +28 -0
- data/templates/openbsd50_amd64/definition.rb +84 -0
- data/templates/openbsd50_amd64/postinstall.sh +81 -0
- data/templates/openbsd50_i386/README +28 -0
- data/templates/openbsd50_i386/definition.rb +84 -0
- data/templates/openbsd50_i386/postinstall.sh +80 -0
- data/templates/openindiana-148-ai-x86/definition.rb +1 -1
- data/templates/openindiana-148-ai-x86/postinstall.sh +1 -1
- data/templates/opensuse-11.4-i386-experimental/postinstall.sh +1 -1
- data/templates/scientificlinux-6.1-i386-netboot/base.sh +1 -0
- data/templates/scientificlinux-6.1-i386-netboot/chef.sh +1 -0
- data/templates/scientificlinux-6.1-i386-netboot/cleanup.sh +4 -0
- data/templates/scientificlinux-6.1-i386-netboot/definition.rb +35 -0
- data/templates/scientificlinux-6.1-i386-netboot/ks.cfg +53 -0
- data/templates/scientificlinux-6.1-i386-netboot/postinstall.sh +30 -0
- data/templates/scientificlinux-6.1-i386-netboot/puppet.sh +1 -0
- data/templates/scientificlinux-6.1-i386-netboot/vagrant.sh +8 -0
- data/templates/scientificlinux-6.1-i386-netboot/virtualbox.sh +8 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/base.sh +1 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/chef.sh +1 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/cleanup.sh +4 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/definition.rb +35 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/ks.cfg +53 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/postinstall.sh +30 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/puppet.sh +1 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/vagrant.sh +8 -0
- data/templates/scientificlinux-6.1-x86_64-netboot/virtualbox.sh +8 -0
- data/templates/solaris-11-express-i386/definition.rb +1 -1
- data/templates/solaris-11-express-i386/postinstall.sh +1 -1
- data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +12 -11
- data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +12 -11
- data/templates/ubuntu-10.04.3-server-amd64-alt/definition.rb +2 -2
- data/templates/ubuntu-10.04.3-server-amd64-alt/postinstall.sh +12 -11
- data/templates/ubuntu-10.04.3-server-amd64/vagrant.sh +1 -1
- data/templates/ubuntu-10.04.3-server-i386/postinstall.sh +12 -11
- data/templates/ubuntu-10.04.4-server-amd64/definition.rb +24 -0
- data/templates/ubuntu-10.04.4-server-amd64/postinstall.sh +92 -0
- data/templates/ubuntu-10.04.4-server-amd64/preseed.cfg +87 -0
- data/templates/ubuntu-10.04.4-server-i386/definition.rb +24 -0
- data/templates/ubuntu-10.04.4-server-i386/postinstall.sh +92 -0
- data/templates/ubuntu-10.04.4-server-i386/preseed.cfg +87 -0
- data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +12 -11
- data/templates/ubuntu-10.10-server-amd64/postinstall.sh +12 -11
- data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +12 -11
- data/templates/ubuntu-10.10-server-i386/postinstall.sh +12 -11
- data/templates/ubuntu-11.04-server-amd64/ssh-keys.sh +1 -1
- data/templates/ubuntu-11.04-server-i386/definition.rb +1 -1
- data/templates/ubuntu-11.04-server-i386/postinstall.sh +12 -11
- data/templates/ubuntu-11.10-server-amd64-ishaya/definition.rb +24 -0
- data/templates/ubuntu-11.10-server-amd64-ishaya/postinstall.sh +91 -0
- data/templates/ubuntu-11.10-server-amd64-ishaya/preseed.cfg +87 -0
- data/templates/ubuntu-11.10-server-amd64-ruby192/definition.rb +24 -0
- data/templates/ubuntu-11.10-server-amd64-ruby192/postinstall.sh +91 -0
- data/templates/ubuntu-11.10-server-amd64-ruby192/preseed.cfg +87 -0
- data/templates/ubuntu-11.10-server-amd64-rvm/definition.rb +35 -0
- data/templates/ubuntu-11.10-server-amd64-rvm/postinstall.sh +85 -0
- data/templates/ubuntu-11.10-server-amd64-rvm/preseed.cfg +93 -0
- data/templates/ubuntu-11.10-server-amd64/definition.rb +35 -0
- data/templates/ubuntu-11.10-server-amd64/postinstall.sh +89 -0
- data/templates/ubuntu-11.10-server-amd64/preseed.cfg +87 -0
- data/templates/ubuntu-11.10-server-i386/definition.rb +35 -0
- data/templates/ubuntu-11.10-server-i386/postinstall.sh +89 -0
- data/templates/ubuntu-11.10-server-i386/preseed.cfg +87 -0
- data/templates/ubuntu-12.04-server-amd64-packages/definition.rb +37 -0
- data/templates/{Debian-6.0.2-amd64-netboot → ubuntu-12.04-server-amd64-packages}/postinstall.sh +33 -32
- data/templates/ubuntu-12.04-server-amd64-packages/preseed.cfg +87 -0
- data/templates/ubuntu-12.04-server-amd64/definition.rb +37 -0
- data/templates/ubuntu-12.04-server-amd64/postinstall.sh +92 -0
- data/templates/ubuntu-12.04-server-amd64/preseed.cfg +87 -0
- data/templates/ubuntu-8.04.4-server-amd64/definition.rb +1 -0
- data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +19 -17
- data/templates/ubuntu-8.04.4-server-amd64/preseed.cfg +0 -1
- data/templates/ubuntu-8.04.4-server-i386/definition.rb +1 -1
- data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +34 -11
- data/templates/windows-2008R1-serverstandard-amd64/Autounattend.xml +146 -0
- data/templates/windows-2008R1-serverstandard-amd64/README.md +134 -0
- data/templates/windows-2008R1-serverstandard-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverstandard-amd64/definition.rb +114 -0
- data/templates/windows-2008R1-serverstandard-amd64/install-cygwin-sshd.bat +41 -0
- data/templates/windows-2008R1-serverstandard-amd64/install-guest-additions.bat +5 -0
- data/templates/windows-2008R1-serverstandard-amd64/install-winrm.bat +16 -0
- data/templates/windows-2008R1-serverstandard-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverstandard-amd64/postinstall.sh +75 -0
- data/templates/windows-2008R1-serverstandard-amd64/sudo +2 -0
- data/templates/windows-2008R1-serverstandard-amd64/winrm.rb +8 -0
- data/templates/windows-2008R1-serverweb-amd64/Autounattend.xml +162 -0
- data/templates/windows-2008R1-serverweb-amd64/README.md +134 -0
- data/templates/windows-2008R1-serverweb-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverweb-amd64/definition.rb +131 -0
- data/templates/windows-2008R1-serverweb-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-2008R1-serverweb-amd64/install-guest-additions.bat +5 -0
- data/templates/windows-2008R1-serverweb-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R1-serverweb-amd64/install-winrm.bat +16 -0
- data/templates/windows-2008R1-serverweb-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverweb-amd64/postinstall.sh +74 -0
- data/templates/windows-2008R1-serverweb-amd64/sudo +2 -0
- data/templates/windows-2008R1-serverweb-amd64/winrm.rb +8 -0
- data/templates/windows-2008R1-serverweb-i386/Autounattend.xml +142 -0
- data/templates/windows-2008R1-serverweb-i386/README.md +136 -0
- data/templates/windows-2008R1-serverweb-i386/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverweb-i386/definition.rb +132 -0
- data/templates/windows-2008R1-serverweb-i386/install-cygwin-sshd.bat +40 -0
- data/templates/windows-2008R1-serverweb-i386/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R1-serverweb-i386/install-winrm.bat +14 -0
- data/templates/windows-2008R1-serverweb-i386/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverweb-i386/postinstall.sh +74 -0
- data/templates/windows-2008R1-serverweb-i386/sudo +2 -0
- data/templates/windows-2008R1-serverweb-i386/winrm.rb +8 -0
- data/templates/windows-2008R1-serverwebcore-amd64/Autounattend.xml +162 -0
- data/templates/windows-2008R1-serverwebcore-amd64/README.md +134 -0
- data/templates/windows-2008R1-serverwebcore-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverwebcore-amd64/definition.rb +132 -0
- data/templates/windows-2008R1-serverwebcore-amd64/install-cygwin-sshd.bat +41 -0
- data/templates/windows-2008R1-serverwebcore-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R1-serverwebcore-amd64/install-winrm.bat +14 -0
- data/templates/windows-2008R1-serverwebcore-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverwebcore-amd64/postinstall.sh +74 -0
- data/templates/windows-2008R1-serverwebcore-amd64/sudo +2 -0
- data/templates/windows-2008R1-serverwebcore-amd64/winrm.rb +8 -0
- data/templates/windows-2008R2-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R2-amd64/install-winrm.bat +2 -0
- data/templates/windows-2008R2-amd64/postinstall.sh +1 -1
- data/templates/windows-2008R2-serverstandard-amd64/Autounattend.xml +147 -0
- data/templates/windows-2008R2-serverstandard-amd64/README.md +142 -0
- data/templates/windows-2008R2-serverstandard-amd64/definition.rb +43 -0
- data/templates/windows-2008R2-serverstandard-amd64/install-cygwin-sshd.bat +41 -0
- data/templates/windows-2008R2-serverstandard-amd64/install-winrm.bat +11 -0
- data/templates/windows-2008R2-serverstandard-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R2-serverstandard-amd64/postinstall.sh +74 -0
- data/templates/windows-2008R2-serverweb-amd64/Autounattend.xml +151 -0
- data/templates/windows-2008R2-serverweb-amd64/README.md +142 -0
- data/templates/windows-2008R2-serverweb-amd64/definition.rb +38 -0
- data/templates/windows-2008R2-serverweb-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-2008R2-serverweb-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R2-serverweb-amd64/install-winrm.bat +11 -0
- data/templates/windows-2008R2-serverweb-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R2-serverweb-amd64/postinstall.sh +74 -0
- data/templates/windows-2008R2-serverwebcore-amd64/Autounattend.xml +145 -0
- data/templates/windows-2008R2-serverwebcore-amd64/README.md +142 -0
- data/templates/windows-2008R2-serverwebcore-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R2-serverwebcore-amd64/definition.rb +46 -0
- data/templates/windows-2008R2-serverwebcore-amd64/install-cygwin-sshd.bat +41 -0
- data/templates/windows-2008R2-serverwebcore-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-2008R2-serverwebcore-amd64/install-winrm.bat +11 -0
- data/templates/windows-2008R2-serverwebcore-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R2-serverwebcore-amd64/postinstall.sh +74 -0
- data/templates/windows-7-enterprise-amd64/Autounattend.xml +155 -0
- data/templates/windows-7-enterprise-amd64/README.md +52 -0
- data/templates/windows-7-enterprise-amd64/definition.rb +40 -0
- data/templates/windows-7-enterprise-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7-enterprise-amd64/install-vbox-guest.bat +2 -0
- data/templates/windows-7-enterprise-amd64/install-winrm.bat +14 -0
- data/templates/windows-7-enterprise-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-enterprise-amd64/postinstall.sh +74 -0
- data/templates/windows-7-enterprise-i386/Autounattend.xml +151 -0
- data/templates/windows-7-enterprise-i386/README.md +169 -0
- data/templates/windows-7-enterprise-i386/definition.rb +40 -0
- data/templates/windows-7-enterprise-i386/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7-enterprise-i386/install-winrm.bat +14 -0
- data/templates/windows-7-enterprise-i386/oracle-cert.cer +0 -0
- data/templates/windows-7-enterprise-i386/postinstall.sh +74 -0
- data/templates/windows-7-premium-amd64/Autounattend.xml +152 -0
- data/templates/windows-7-premium-amd64/README.md +171 -0
- data/templates/windows-7-premium-amd64/definition.rb +38 -0
- data/templates/windows-7-premium-amd64/install-chefclient.bat +44 -0
- data/templates/windows-7-premium-amd64/install-winrm.bat +11 -0
- data/templates/windows-7-premium-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-premium-amd64/postinstall.sh +124 -0
- data/templates/windows-7-premium-amd64/winrm.rb +8 -0
- data/templates/windows-7-professional-amd64/Autounattend.xml +152 -0
- data/templates/windows-7-professional-amd64/README.md +171 -0
- data/templates/windows-7-professional-amd64/definition.rb +41 -0
- data/templates/windows-7-professional-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7-professional-amd64/install-winrm.bat +14 -0
- data/templates/windows-7-professional-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-professional-amd64/postinstall.sh +74 -0
- data/templates/windows-7-ultimate-amd64/Autounattend.xml +152 -0
- data/templates/windows-7-ultimate-amd64/README.md +89 -0
- data/templates/windows-7-ultimate-amd64/definition.rb +41 -0
- data/templates/windows-7-ultimate-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7-ultimate-amd64/install-winrm.bat +14 -0
- data/templates/windows-7-ultimate-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-ultimate-amd64/postinstall.sh +74 -0
- data/templates/windows-7sp1-ultimate-amd64/Autounattend.xml +149 -0
- data/templates/windows-7sp1-ultimate-amd64/README.md +89 -0
- data/templates/windows-7sp1-ultimate-amd64/definition.rb +42 -0
- data/templates/windows-7sp1-ultimate-amd64/install-cygwin-sshd.bat +40 -0
- data/templates/windows-7sp1-ultimate-amd64/install-winrm.bat +14 -0
- data/templates/windows-7sp1-ultimate-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7sp1-ultimate-amd64/postinstall.sh +74 -0
- data/templates/windows-8-preview-dev-amd64/Autounattend.xml +140 -0
- data/templates/windows-8-preview-dev-amd64/README.md +134 -0
- data/templates/windows-8-preview-dev-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-8-preview-dev-amd64/definition.rb +114 -0
- data/templates/windows-8-preview-dev-amd64/install-cygwin-sshd.bat +38 -0
- data/templates/windows-8-preview-dev-amd64/install-winrm.bat +11 -0
- data/templates/windows-8-preview-dev-amd64/oracle-cert.cer +0 -0
- data/templates/windows-8-preview-dev-amd64/postinstall.sh +122 -0
- data/templates/windows-8-preview-dev-amd64/winrm.rb +8 -0
- data/test/build_realtest.rb +71 -0
- data/test/definition_test.rb +3 -3
- data/test/definitions/test_definition/_disabled_postinstall.sh +1 -0
- data/test/definitions/test_definition/definition.rb +14 -17
- data/test/definitions/test_definition/enabled_postinstall.sh +1 -0
- data/test/environment_test.rb +4 -4
- data/validation/features/steps/{ssh_steps.rb → ssh_steps.old} +0 -0
- data/validation/features/steps/veewee_steps.rb +27 -0
- data/validation/veewee.feature +45 -0
- data/veewee.gemspec +18 -11
- metadata +500 -175
- data/Gemfile.lock +0 -98
- data/README-LIB.md +0 -2
- data/lib/veewee/builder/core/box.rb +0 -32
- data/lib/veewee/builder/core/builder/build.rb +0 -250
- data/lib/veewee/builder/core/builder/iso.rb +0 -120
- data/lib/veewee/builder/kvm/box.rb +0 -130
- data/lib/veewee/builder/kvm/builder.rb +0 -38
- data/lib/veewee/builder/virtualbox/box.rb +0 -121
- data/lib/veewee/builder/virtualbox/builder.rb +0 -48
- data/lib/veewee/builder/virtualbox/helper/_snapshots.rb +0 -105
- data/lib/veewee/builder/virtualbox/helper/_transaction.rb +0 -135
- data/lib/veewee/builder/virtualbox/helper/console_type.rb +0 -62
- data/lib/veewee/builder/virtualbox/helper/create.rb +0 -210
- data/lib/veewee/builder/virtualbox/helper/destroy.rb +0 -79
- data/lib/veewee/builder/virtualbox/helper/export_vagrant.rb +0 -87
- data/lib/veewee/builder/virtualbox/helper/validate_vagrant.rb +0 -35
- data/lib/veewee/builder/vmfusion/box.rb +0 -137
- data/lib/veewee/builder/vmfusion/builder.rb +0 -78
- data/lib/veewee/builder/vmfusion/helper/export_ova.rb +0 -26
- data/lib/veewee/builder/vmfusion/helper/validate_vmfusion.rb +0 -37
- data/lib/veewee/config/builders.rb +0 -36
- data/lib/veewee/util/scancode.rb +0 -112
- data/lib/veewee/util/shell.rb +0 -42
- data/lib/veewee/util/ssh.rb +0 -158
- data/lib/veewee/util/tcp.rb +0 -88
- data/lib/veewee/util/web.rb +0 -63
- data/lib/veewee/vagrant/config.rb +0 -7
- data/test/build_test.rb +0 -50
- data/test/definitions/test_definition/_test_me.sh +0 -1
- data/validation/vagrant.feature +0 -68
@@ -1,130 +0,0 @@
|
|
1
|
-
require 'veewee/builder/core/box'
|
2
|
-
require 'veewee/builder/core/box/vnc'
|
3
|
-
|
4
|
-
module Veewee
|
5
|
-
module Builder
|
6
|
-
module Kvm
|
7
|
-
class Box < Veewee::Builder::Core::Box
|
8
|
-
|
9
|
-
include ::Veewee::Builder::Core
|
10
|
-
include ::Veewee::Builder::Kvm
|
11
|
-
|
12
|
-
include ::Veewee::Builder::Core::BoxCommand
|
13
|
-
|
14
|
-
attr_accessor :connection
|
15
|
-
|
16
|
-
def initialize(name,env)
|
17
|
-
|
18
|
-
require 'libvirt'
|
19
|
-
require 'fog'
|
20
|
-
|
21
|
-
super(name,env)
|
22
|
-
|
23
|
-
@connection=::Fog::Compute.new(:provider => "Libvirt",
|
24
|
-
:libvirt_uri => "qemu:///system",
|
25
|
-
:libvirt_ip_command => "arp -an |grep $mac|cut -d '(' -f 2 | cut -d ')' -f 1")
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
# Type on the console
|
30
|
-
def console_type(sequence,type_options={})
|
31
|
-
vnc_port=@connection.servers.all(:name => name).first.vnc_port
|
32
|
-
display_port=vnc_port.to_i - 5900
|
33
|
-
env.ui.confirm "Sending keystrokes to VNC port :#{display_port} - TCP port: #{vnc_port}"
|
34
|
-
vnc_type(sequence,"localhost",display_port)
|
35
|
-
end
|
36
|
-
|
37
|
-
|
38
|
-
# Create a new vm
|
39
|
-
def create(definition)
|
40
|
-
# Assemble the Virtualmachine and set all the memory and other stuff"
|
41
|
-
|
42
|
-
#memory_size,cpu_count, volume_size
|
43
|
-
|
44
|
-
s=@connection.servers.create(
|
45
|
-
:name => name,
|
46
|
-
:memory_size => definition.memory_size.to_i*1024,
|
47
|
-
:cpus => definition.cpu_count.to_i,
|
48
|
-
:volume_capacity => "#{definition.disk_size}M",
|
49
|
-
:network_interface_type => "nat",
|
50
|
-
:iso_file => definition.iso_file,
|
51
|
-
:arch => definition.os_type_id.end_with?("_64") ? "x86_64" : "i686",
|
52
|
-
:iso_dir => env.config.veewee.iso_dir
|
53
|
-
)
|
54
|
-
end
|
55
|
-
|
56
|
-
# Create the volume of a new vm
|
57
|
-
def create_volume
|
58
|
-
# Creating the volume is part of the server creation
|
59
|
-
end
|
60
|
-
|
61
|
-
# Destroy a vm
|
62
|
-
def destroy
|
63
|
-
if @connection.servers.all(:name => name).nil?
|
64
|
-
env.ui.error "Error:: You tried to destroy a non-existing box '#{name}'"
|
65
|
-
exit -1
|
66
|
-
end
|
67
|
-
|
68
|
-
halt if running?
|
69
|
-
destroy_vm if exists_vm?
|
70
|
-
|
71
|
-
vol_exists=!@connection.volumes.all(:name => "#{name}.img").nil?
|
72
|
-
env.logger.info "Volume exists? : #{vol_exists}"
|
73
|
-
destroy_volume if exists_volume?
|
74
|
-
end
|
75
|
-
|
76
|
-
def destroy_vm
|
77
|
-
matched_servers=@connection.servers.all(:name => name)
|
78
|
-
matched_servers.first.destroy() unless matched_servers.nil?
|
79
|
-
end
|
80
|
-
|
81
|
-
def destroy_volume
|
82
|
-
vol=@connection.volumes.all(:name => "#{name}.img").first
|
83
|
-
vol.destroy
|
84
|
-
end
|
85
|
-
|
86
|
-
def start(mode)
|
87
|
-
matched_servers=@connection.servers.all(:name => name)
|
88
|
-
matched_servers.first.start unless matched_servers.nil?
|
89
|
-
end
|
90
|
-
|
91
|
-
def halt
|
92
|
-
matched_servers=@connection.servers.all(:name => name)
|
93
|
-
matched_servers.first.halt unless matched_servers.nil?
|
94
|
-
end
|
95
|
-
|
96
|
-
def stop
|
97
|
-
matched_servers=@connection.servers.all(:name => name)
|
98
|
-
matched_servers.first.stop unless matched_servers.nil?
|
99
|
-
end
|
100
|
-
|
101
|
-
def ip_address
|
102
|
-
ip=@connection.servers.all(:name => "#{name}").first.addresses[:public]
|
103
|
-
return ip.first unless ip.nil?
|
104
|
-
return ip
|
105
|
-
end
|
106
|
-
|
107
|
-
def running?
|
108
|
-
if exists_vm?
|
109
|
-
@connection.servers.all(:name => name).first.ready?
|
110
|
-
else
|
111
|
-
false
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
def exists?
|
116
|
-
exists_volume? || exists_vm?
|
117
|
-
end
|
118
|
-
|
119
|
-
def exists_volume?
|
120
|
-
!@connection.volumes.all(:name => "#{name}.img").nil?
|
121
|
-
end
|
122
|
-
|
123
|
-
def exists_vm?
|
124
|
-
!@connection.servers.all(:name => name).nil?
|
125
|
-
end
|
126
|
-
|
127
|
-
end # End Class
|
128
|
-
end # End Module
|
129
|
-
end # End Module
|
130
|
-
end # End Module
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'veewee/builder/core/builder'
|
2
|
-
|
3
|
-
module Veewee
|
4
|
-
module Builder
|
5
|
-
module Kvm
|
6
|
-
class Builder < Veewee::Builder::Core::Builder
|
7
|
-
|
8
|
-
# Translate the definition ssh options to ssh options that can be passed to Net::Ssh calls
|
9
|
-
# We expect plain ssh for a connection
|
10
|
-
|
11
|
-
def check_requirements
|
12
|
-
["ruby-libvirt","fog"].each do |gemname|
|
13
|
-
unless gem_available?(gemname)
|
14
|
-
raise Veewee::Error,"The kvm Builder requires the gem '#{gemname}' to be installed\n" + "gem install #{gemname}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def ssh_options(definition)
|
20
|
-
ssh_options={
|
21
|
-
:user => definition.ssh_user,
|
22
|
-
:port => 22,
|
23
|
-
:password => definition.ssh_password,
|
24
|
-
:timeout => definition.ssh_login_timeout.to_i
|
25
|
-
}
|
26
|
-
return ssh_options
|
27
|
-
end
|
28
|
-
|
29
|
-
def build(definition_name,box_name,options)
|
30
|
-
|
31
|
-
super(definition_name,box_name,options)
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
end #End Class
|
36
|
-
end # End Module
|
37
|
-
end # End Module
|
38
|
-
end # End Module
|
@@ -1,121 +0,0 @@
|
|
1
|
-
require 'veewee/builder/core/box'
|
2
|
-
|
3
|
-
require 'veewee/builder/virtualbox/helper/create'
|
4
|
-
require 'veewee/builder/virtualbox/helper/console_type'
|
5
|
-
require 'veewee/builder/virtualbox/helper/destroy'
|
6
|
-
|
7
|
-
module Veewee
|
8
|
-
module Builder
|
9
|
-
module Virtualbox
|
10
|
-
class Box < Veewee::Builder::Core::Box
|
11
|
-
|
12
|
-
include ::Veewee::Builder::Virtualbox::BoxHelper
|
13
|
-
|
14
|
-
def initialize(name,env)
|
15
|
-
|
16
|
-
require 'virtualbox'
|
17
|
-
@vboxcmd=determine_vboxcmd
|
18
|
-
super(name,env)
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
def determine_vboxcmd
|
23
|
-
return "VBoxManage"
|
24
|
-
end
|
25
|
-
|
26
|
-
def exists?
|
27
|
-
vm=VirtualBox::VM.find(name)
|
28
|
-
env.logger.info ("Vm exists? #{!vm.nil?}")
|
29
|
-
return !vm.nil?
|
30
|
-
end
|
31
|
-
|
32
|
-
def running?
|
33
|
-
return
|
34
|
-
end
|
35
|
-
|
36
|
-
def create(definition)
|
37
|
-
|
38
|
-
guessed_port=guess_free_port(definition.ssh_host_port.to_i,definition.ssh_host_port.to_i+40).to_s
|
39
|
-
if guessed_port.to_s!=definition.ssh_host_port
|
40
|
-
env.ui.warn "Changing ssh port from #{definition.ssh_host_port} to #{guessed_port}"
|
41
|
-
definition.ssh_host_port=guessed_port.to_s
|
42
|
-
end
|
43
|
-
|
44
|
-
#Suppress those annoying virtualbox messages
|
45
|
-
suppress_messages
|
46
|
-
|
47
|
-
create_vm(definition)
|
48
|
-
|
49
|
-
# Adds a folder to the vm for testing purposes
|
50
|
-
add_shared_folder(definition)
|
51
|
-
|
52
|
-
#Create a disk with the same name as the box_name
|
53
|
-
create_disk(definition)
|
54
|
-
|
55
|
-
add_ide_controller(definition)
|
56
|
-
attach_isofile(definition)
|
57
|
-
|
58
|
-
add_sata_controller(definition)
|
59
|
-
attach_disk(definition)
|
60
|
-
|
61
|
-
create_floppy(definition)
|
62
|
-
add_floppy_controller(definition)
|
63
|
-
attach_floppy(definition)
|
64
|
-
|
65
|
-
add_ssh_nat_mapping(definition)
|
66
|
-
|
67
|
-
end
|
68
|
-
|
69
|
-
def start(gui_enabled=true)
|
70
|
-
# Once assembled we start the machine
|
71
|
-
env.logger.info "Started the VM with GUI Enabled? #{gui_enabled}"
|
72
|
-
if (gui_enabled)
|
73
|
-
raw.start("gui")
|
74
|
-
else
|
75
|
-
raw.start("vrdp")
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
def stop
|
80
|
-
# If the vm is not powered off, perform a shutdown
|
81
|
-
if (!raw.nil? && !(raw.powered_off?))
|
82
|
-
env.ui.info "Shutting down vm #{name}"
|
83
|
-
#We force it here, maybe vm.shutdown is cleaner
|
84
|
-
begin
|
85
|
-
raw.stop
|
86
|
-
sleep 3
|
87
|
-
rescue VirtualBox::Exceptions::InvalidVMStateException
|
88
|
-
env.ui.error "There was problem sending the stop command because the machine is in an Invalid state"
|
89
|
-
env.ui.error "Please verify leftovers from a previous build in your vm folder"
|
90
|
-
exit -1
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
end
|
95
|
-
|
96
|
-
def halt
|
97
|
-
if (!raw.nil? && !(raw.powered_off?))
|
98
|
-
env.ui.info "Halting vm #{name}"
|
99
|
-
#We force it here, maybe vm.shutdown is cleaner
|
100
|
-
# VBoxManage controlvm 'lucid64' poweroff
|
101
|
-
begin
|
102
|
-
raw.halt
|
103
|
-
rescue VirtualBox::Exceptions::InvalidVMStateException
|
104
|
-
env.ui.error "There was problem sending the stop command because the machine is in an Invalid state"
|
105
|
-
env.ui.error "Please verify leftovers from a previous build in your vm folder"
|
106
|
-
exit -1
|
107
|
-
end
|
108
|
-
sleep 3
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
# Get the IP address of the box
|
113
|
-
def ip_address
|
114
|
-
return "127.0.0.1"
|
115
|
-
end
|
116
|
-
|
117
|
-
|
118
|
-
end # End Class
|
119
|
-
end # End Module
|
120
|
-
end # End Module
|
121
|
-
end # End Module
|
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'veewee/builder/core/builder'
|
2
|
-
require 'veewee/builder/virtualbox/helper/export_vagrant'
|
3
|
-
require 'veewee/builder/virtualbox/helper/validate_vagrant'
|
4
|
-
|
5
|
-
module Veewee
|
6
|
-
module Builder
|
7
|
-
module Virtualbox
|
8
|
-
class Builder < Veewee::Builder::Core::Builder
|
9
|
-
|
10
|
-
include ::Veewee::Builder::Virtualbox::BuilderHelper
|
11
|
-
|
12
|
-
def check_requirements
|
13
|
-
unless gem_available?("virtualbox")
|
14
|
-
raise Veewee::Error,"The Virtualbox Builder requires the gem 'virtualbox' to be installed"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def ssh_options(definition)
|
19
|
-
|
20
|
-
ssh_options={
|
21
|
-
:user => definition.ssh_user,
|
22
|
-
:port => definition.ssh_host_port,
|
23
|
-
:password => definition.ssh_password,
|
24
|
-
:timeout => definition.ssh_login_timeout.to_i
|
25
|
-
}
|
26
|
-
return ssh_options
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
def build_info
|
31
|
-
info=super
|
32
|
-
info << { :filename => ".vbox_version",
|
33
|
-
:content => "#{VirtualBox::Global.global.lib.virtualbox.version.split('_')[0]}" }
|
34
|
-
end
|
35
|
-
|
36
|
-
def build(definition_name,box_name,options)
|
37
|
-
|
38
|
-
super(definition_name,box_name,options)
|
39
|
-
|
40
|
-
# w00t, we have succesfully reach this point
|
41
|
-
# so we let user know , the vm is ready to be exported
|
42
|
-
|
43
|
-
end
|
44
|
-
|
45
|
-
end #End Class
|
46
|
-
end # End Module
|
47
|
-
end # End Module
|
48
|
-
end # End Module
|
@@ -1,105 +0,0 @@
|
|
1
|
-
##Note: this is currently not used anymore, it seems no one is using it
|
2
|
-
|
3
|
-
require 'veewee/util/shell'
|
4
|
-
require 'veewee/util/tcp'
|
5
|
-
|
6
|
-
module Veewee
|
7
|
-
module Builder
|
8
|
-
module Virtualbox
|
9
|
-
|
10
|
-
def remove_snapshot_vmachine(vmname,snapname)
|
11
|
-
Veewee::Shell.execute("#{@vboxcmd} snapshot '#{vmname}' delete '#{snapname}'")
|
12
|
-
end
|
13
|
-
|
14
|
-
def create_snapshot_vmachine(vmname,snapname)
|
15
|
-
Veewee::Shell.execute("#{@vboxcmd} snapshot '#{vmname}' take '#{snapname}'")
|
16
|
-
end
|
17
|
-
|
18
|
-
def load_snapshot_vmachine(vmname,snapname)
|
19
|
-
#if it running , shutdown first
|
20
|
-
if (state_vmachine(vmname)=="running")
|
21
|
-
stop_vmachine(vmname)
|
22
|
-
end
|
23
|
-
|
24
|
-
Veewee::Shell.execute("#{@vboxcmd} snapshot '#{vmname}' restore '#{snapname}'")
|
25
|
-
#sometimes it takes some time to shutdown
|
26
|
-
sleep 2
|
27
|
-
Veewee::Shell.execute("#{@vboxcmd} startvm '#{vmname}'")
|
28
|
-
end
|
29
|
-
|
30
|
-
def snapshot_exists(vmname,snapname)
|
31
|
-
list_snapshots(vmname).each { |name|
|
32
|
-
if (name==snapname) then
|
33
|
-
return true
|
34
|
-
end
|
35
|
-
}
|
36
|
-
return false
|
37
|
-
end
|
38
|
-
|
39
|
-
def snapshot_version_exists(vmname,snapname)
|
40
|
-
list_snapshots(vmname).each { |name|
|
41
|
-
if name.match(/^#{snapname}-/) then
|
42
|
-
return true
|
43
|
-
end
|
44
|
-
}
|
45
|
-
return false
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.rollback_snapshot(vmname,snapname)
|
49
|
-
delete_flag=false
|
50
|
-
@vboxcmd=Veewee::Environment.determine_vboxcmd
|
51
|
-
|
52
|
-
savestate_recover=false
|
53
|
-
if (state_vmachine(vmname)=="running")
|
54
|
-
Veewee::Shell.execute("#{@vboxcmd} controlvm '#{vmname}' savestate")
|
55
|
-
savestate_recover=true
|
56
|
-
end
|
57
|
-
|
58
|
-
list_snapshots(vmname).each { |name|
|
59
|
-
if name.match(/^#{snapname}-/) then
|
60
|
-
delete_flag=true
|
61
|
-
end
|
62
|
-
if (delete_flag) then
|
63
|
-
remove_snapshot_vmachine(vmname,name)
|
64
|
-
sleep 1
|
65
|
-
end
|
66
|
-
}
|
67
|
-
|
68
|
-
|
69
|
-
sleep 2
|
70
|
-
|
71
|
-
Veewee::Shell.execute("#{@vboxcmd} startvm '#{vmname}'")
|
72
|
-
|
73
|
-
if (savestate_recover)
|
74
|
-
#Recovering from savestate nukes the network! This trick seem to work
|
75
|
-
#Also within the vm /etc/init.d/networking restart , but that is OS specific
|
76
|
-
#http://www.virtualbox.org/ticket/5666
|
77
|
-
#http://www.virtualbox.org/ticket/5654
|
78
|
-
#This is supposed to be fixed: http://www.virtualbox.org/changeset/25205 but alas
|
79
|
-
Veewee::Shell.execute("#{@vboxcmd} controlvm '#{vmname}' nic1 nat")
|
80
|
-
Veewee::Shell.execute("#{@vboxcmd} controlvm '#{vmname}' setlinkstate1 off")
|
81
|
-
Veewee::Shell.execute("#{@vboxcmd} controlvm '#{vmname}' setlinkstate1 on")
|
82
|
-
sleep 2
|
83
|
-
|
84
|
-
#hmmm, virtualbox => when recovering from a restore , it looses the nat settings!!! So we need to do this again!!
|
85
|
-
#thebox.ssh_enable_vmachine({:hostport => host_port , :guestport => 22} )
|
86
|
-
#http://www.virtualbox.org/changeset/25402
|
87
|
-
#[25402]: NAT: re-establish port-forwarding after savestate / restore state
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
92
|
-
|
93
|
-
|
94
|
-
def self.list_snapshots(vmname)
|
95
|
-
@vboxcmd=Veewee::Environment.determine_vboxcmd
|
96
|
-
|
97
|
-
snapshotresult=Veewee::Shell.execute("#{@vboxcmd} showvminfo --machinereadable '#{vmname}' |grep ^SnapshotName| cut -d '=' -f 2").stdout
|
98
|
-
snapshotlist=snapshotresult.gsub(/\"/,'').split(/\n/)
|
99
|
-
return snapshotlist
|
100
|
-
end
|
101
|
-
|
102
|
-
end #Module
|
103
|
-
end #Module
|
104
|
-
end #Module
|
105
|
-
|
@@ -1,135 +0,0 @@
|
|
1
|
-
##Note: this is currently not used anymore, it seems no one is using it
|
2
|
-
|
3
|
-
require 'veewee/util/shell'
|
4
|
-
require 'veewee/util/tcp'
|
5
|
-
|
6
|
-
module Veewee
|
7
|
-
module Builder
|
8
|
-
module Virtualbox
|
9
|
-
|
10
|
-
def transaction(step_name,checksums,&block)
|
11
|
-
|
12
|
-
current_step_nr=step_name.split("-")[0].to_i
|
13
|
-
|
14
|
-
vm=VirtualBox::VM.find(@box_name)
|
15
|
-
snapnames=Array.new
|
16
|
-
|
17
|
-
#If vm exists , look for snapshots
|
18
|
-
if !vm.nil?
|
19
|
-
start_snapshot=vm.root_snapshot
|
20
|
-
snapshot=start_snapshot
|
21
|
-
counter=0
|
22
|
-
|
23
|
-
while (snapshot!=nil)
|
24
|
-
#env.ui.info "#{counter}:#{snapshot.name}"
|
25
|
-
snapnames[counter]=snapshot.name
|
26
|
-
counter=counter+1
|
27
|
-
snapshot=snapshot.children[0]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
#find the last snapshot matching the state
|
32
|
-
counter=[snapnames.length, checksums.length].min-1
|
33
|
-
last_good_state=counter
|
34
|
-
for c in 0..counter do
|
35
|
-
#env.ui.info "#{c}- #{snapnames[c]} - #{checksums[c]}"
|
36
|
-
if !snapnames[c].match("#{c}.*-#{checksums[c]}")
|
37
|
-
# env.ui.info "we found a bad state"
|
38
|
-
last_good_state=c-1
|
39
|
-
break
|
40
|
-
end
|
41
|
-
end
|
42
|
-
#env.ui.info "Last good state: #{last_good_state}"
|
43
|
-
|
44
|
-
if (current_step_nr < last_good_state)
|
45
|
-
#env.ui.info "fast forwarding #{step_name}"
|
46
|
-
return
|
47
|
-
end
|
48
|
-
|
49
|
-
#env.ui.info "Current step: #{current_step_nr}"
|
50
|
-
if (current_step_nr == last_good_state)
|
51
|
-
if vm.running?
|
52
|
-
vm.stop
|
53
|
-
end
|
54
|
-
|
55
|
-
#invalidate later snapshots
|
56
|
-
#env.ui.info "remove old snapshots"
|
57
|
-
|
58
|
-
for s in (last_good_state+1)..(snapnames.length-1)
|
59
|
-
env.ui.info "Removing step [#{s}] snapshot as it is no more valid"
|
60
|
-
snapshot=vm.find_snapshot(snapnames[s])
|
61
|
-
snapshot.destroy
|
62
|
-
#env.ui.info snapshot
|
63
|
-
end
|
64
|
-
|
65
|
-
vm.reload
|
66
|
-
env.ui.info "Loading step #{current_step_nr} snapshots as it has not changed"
|
67
|
-
sleep 2
|
68
|
-
goodsnap=vm.find_snapshot(snapnames[last_good_state])
|
69
|
-
goodsnap.restore
|
70
|
-
sleep 2
|
71
|
-
#TODO:Restore snapshot!!!
|
72
|
-
vm.start
|
73
|
-
sleep 4
|
74
|
-
env.ui.info "Starting machine"
|
75
|
-
end
|
76
|
-
|
77
|
-
#env.ui.info "last good state #{last_good_state}"
|
78
|
-
|
79
|
-
|
80
|
-
if (current_step_nr > last_good_state)
|
81
|
-
|
82
|
-
if (last_good_state==-1)
|
83
|
-
#no initial snapshot is found, clean machine!
|
84
|
-
vm=VirtualBox::VM.find(@box_name)
|
85
|
-
|
86
|
-
if !vm.nil?
|
87
|
-
if vm.running?
|
88
|
-
env.ui.info "Stopping machine"
|
89
|
-
vm.stop
|
90
|
-
while vm.running?
|
91
|
-
sleep 1
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
#detaching cdroms (used to work in 3.x)
|
96
|
-
# vm.medium_attachments.each do |m|
|
97
|
-
# if m.type==:dvd
|
98
|
-
# #env.ui.info "Detaching dvd"
|
99
|
-
# m.detach
|
100
|
-
# end
|
101
|
-
# end
|
102
|
-
|
103
|
-
vm.reload
|
104
|
-
env.ui.info "We found no good state so we are destroying the previous machine+disks"
|
105
|
-
destroy
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|
109
|
-
|
110
|
-
#env.ui.info "(re-)executing step #{step_name}"
|
111
|
-
|
112
|
-
|
113
|
-
yield
|
114
|
-
|
115
|
-
#Need to look it up again because if it was an initial load
|
116
|
-
vm=VirtualBox::VM.find(@box_name)
|
117
|
-
env.ui.info "Step [#{current_step_nr}] was succesfully - saving state"
|
118
|
-
vm.save_state
|
119
|
-
sleep 2 #waiting for it to be ok
|
120
|
-
#env.ui.info "about to snapshot #{vm}"
|
121
|
-
#take snapshot after succesful execution
|
122
|
-
vm.take_snapshot(step_name,"snapshot taken by veewee")
|
123
|
-
sleep 2 #waiting for it to be started again
|
124
|
-
vm.start
|
125
|
-
end
|
126
|
-
|
127
|
-
#pp snapnames
|
128
|
-
end
|
129
|
-
|
130
|
-
def transaction(step_name,checksums,&block)
|
131
|
-
yield
|
132
|
-
end
|
133
|
-
end #Module
|
134
|
-
end #Module
|
135
|
-
end #Module
|