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
@@ -0,0 +1,95 @@
|
|
1
|
+
require 'veewee/provider/core/helper/ssh'
|
2
|
+
module Veewee
|
3
|
+
module Provider
|
4
|
+
module Core
|
5
|
+
module BoxCommand
|
6
|
+
|
7
|
+
|
8
|
+
def ssh(command=nil,options={})
|
9
|
+
|
10
|
+
raise Veewee::Error,"Box is not running" unless self.running?
|
11
|
+
|
12
|
+
if (options[:interactive]==true)
|
13
|
+
# Command line options
|
14
|
+
extended_command="#{command}"
|
15
|
+
host_ip=self.ip_address
|
16
|
+
|
17
|
+
unless host_ip.nil? || host_ip==""
|
18
|
+
ssh_command="ssh #{ssh_commandline_options(options)} #{host_ip} \"#{extended_command}\""
|
19
|
+
|
20
|
+
fg_exec(ssh_command,options)
|
21
|
+
|
22
|
+
else
|
23
|
+
env.ui.error "Can't ssh into '#{@name} as we couldn't figure out it's ip-address"
|
24
|
+
end
|
25
|
+
else
|
26
|
+
ssh_options={:user => definition.ssh_user,:password => definition.ssh_password, :port => definition.ssh_host_port}
|
27
|
+
ssh_execute(host_ip,command,ssh_options)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
def ssh_commandline_options(options)
|
34
|
+
|
35
|
+
command_options = [
|
36
|
+
#"-q", #Suppress warning messages
|
37
|
+
# "-T", #Pseudo-terminal will not be allocated because stdin is not a terminal.
|
38
|
+
"-p #{ssh_options[:port]}",
|
39
|
+
"-o UserKnownHostsFile=/dev/null",
|
40
|
+
"-t -o StrictHostKeyChecking=no",
|
41
|
+
"-o IdentitiesOnly=yes",
|
42
|
+
"-o VerifyHostKeyDNS=no"
|
43
|
+
]
|
44
|
+
if !(definition.ssh_key.nil? || definition.ssh_key.length!="")
|
45
|
+
command_options << "-i #{definition.ssh_key}"
|
46
|
+
end
|
47
|
+
commandline_options="#{command_options.join(" ")} ".strip
|
48
|
+
|
49
|
+
user_option=definition.ssh_user.nil? ? "" : "-l #{definition.ssh_user}"
|
50
|
+
|
51
|
+
return "#{commandline_options} #{user_option}"
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def fg_exec(ssh_command,options)
|
56
|
+
# Some hackery going on here. On Mac OS X Leopard (10.5), exec fails
|
57
|
+
# (GH-51). As a workaround, we fork and wait. On all other platforms,
|
58
|
+
# we simply exec.
|
59
|
+
pid = nil
|
60
|
+
pid = fork if Platform.leopard? || Platform.tiger?
|
61
|
+
|
62
|
+
env.logger.info "Executing internal ssh command"
|
63
|
+
env.logger.info ssh_command
|
64
|
+
Kernel.exec ssh_command if pid.nil?
|
65
|
+
Process.wait(pid) if pid
|
66
|
+
end
|
67
|
+
|
68
|
+
# Shameless copy of vagrant
|
69
|
+
class Platform
|
70
|
+
class << self
|
71
|
+
def tiger?
|
72
|
+
platform.include?("darwin8")
|
73
|
+
end
|
74
|
+
|
75
|
+
def leopard?
|
76
|
+
platform.include?("darwin9")
|
77
|
+
end
|
78
|
+
|
79
|
+
[:darwin, :bsd, :linux].each do |type|
|
80
|
+
define_method("#{type}?") do
|
81
|
+
platform.include?(type.to_s)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def platform
|
86
|
+
RbConfig::CONFIG["host_os"].downcase
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
end # Module
|
92
|
+
end # Module
|
93
|
+
end # Module
|
94
|
+
end # Module
|
95
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Veewee
|
2
|
+
module Provider
|
3
|
+
module Core
|
4
|
+
module BoxCommand
|
5
|
+
|
6
|
+
def sudo(scriptname)
|
7
|
+
if definition.ssh_user=="root"
|
8
|
+
return "#{scriptname}"
|
9
|
+
else
|
10
|
+
command=definition.sudo_cmd
|
11
|
+
newcommand=command.gsub(/%p/,"#{definition.ssh_password}")
|
12
|
+
newcommand.gsub!(/%u/,"#{definition.ssh_user}")
|
13
|
+
newcommand.gsub!(/%f/,"#{scriptname}")
|
14
|
+
return newcommand
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end #Module
|
19
|
+
end #Module
|
20
|
+
end #Module
|
21
|
+
end #Module
|
@@ -5,14 +5,14 @@ require 'net/vnc'
|
|
5
5
|
require 'net/vnc/vnc.rb'
|
6
6
|
|
7
7
|
module Veewee
|
8
|
-
module
|
8
|
+
module Provider
|
9
9
|
module Core
|
10
10
|
module BoxCommand
|
11
11
|
|
12
12
|
def vnc_type(sequence,host,display=20)
|
13
13
|
counter=0
|
14
14
|
env.logger.info "Opening VNC #{host} on display #{display}"
|
15
|
-
vnc=Net::VNC.open("#{host}:#{display}",{:wait => 0.
|
15
|
+
vnc=Net::VNC.open("#{host}:#{display}",{:wait => 0.001})
|
16
16
|
sequence.each { |s|
|
17
17
|
counter=counter+1
|
18
18
|
|
@@ -38,9 +38,9 @@ module Veewee
|
|
38
38
|
|
39
39
|
if keycode.is_a?(Symbol)
|
40
40
|
vnc.key_press keycode
|
41
|
-
sleep
|
41
|
+
sleep 1
|
42
42
|
else
|
43
|
-
vnc.type_string keycode,{:wait => 0.
|
43
|
+
vnc.type_string keycode,{:wait => 0.1}
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
module Veewee
|
2
|
+
module Provider
|
3
|
+
module Core
|
4
|
+
module Helper
|
5
|
+
module Iso
|
6
|
+
|
7
|
+
require 'open-uri'
|
8
|
+
require 'progressbar'
|
9
|
+
require 'highline/import'
|
10
|
+
require 'digest/md5'
|
11
|
+
|
12
|
+
def download_iso(url,filename)
|
13
|
+
if !File.exists?(env.config.veewee.iso_dir)
|
14
|
+
env.ui.info "Creating an iso directory"
|
15
|
+
FileUtils.mkdir(env.config.veewee.iso_dir)
|
16
|
+
end
|
17
|
+
env.ui.info "Checking if isofile #{filename} already exists."
|
18
|
+
full_path=File.join(env.config.veewee.iso_dir,filename)
|
19
|
+
env.ui.info "Full path: #{full_path}"
|
20
|
+
if File.exists?(full_path)
|
21
|
+
env.ui.info ""
|
22
|
+
env.ui.info "The isofile #{filename} already exists."
|
23
|
+
else
|
24
|
+
download_progress(url,full_path)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def download_progress(url,localfile)
|
29
|
+
pbar = nil
|
30
|
+
URI.parse(url).open(
|
31
|
+
:content_length_proc => lambda {|t|
|
32
|
+
if t && 0 < t
|
33
|
+
pbar = ProgressBar.new("Fetching file", t)
|
34
|
+
pbar.file_transfer_mode
|
35
|
+
end
|
36
|
+
},
|
37
|
+
:progress_proc => lambda {|s|
|
38
|
+
pbar.set s if pbar
|
39
|
+
}) { |src|
|
40
|
+
# We assume large 10K files, so this is tempfile object
|
41
|
+
env.logger.info "#{src.class}"
|
42
|
+
env.ui.info "Moving #{src.path} to #{localfile}"
|
43
|
+
FileUtils.mv(src.path,localfile)
|
44
|
+
#open(localfile,"wb") { |dst|
|
45
|
+
#dst.write(src.read)
|
46
|
+
#}
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Compute hash code
|
51
|
+
def hashsum(filename)
|
52
|
+
checksum=Digest::MD5.new
|
53
|
+
buflen=1024
|
54
|
+
open(filename, "r") do |io|
|
55
|
+
counter = 0
|
56
|
+
while (!io.eof)
|
57
|
+
readBuf = io.readpartial(buflen)
|
58
|
+
env.ui.info('.',{:new_line => false}) if ((counter+=1) % 20000 == 0)
|
59
|
+
checksum.update(readBuf)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
return checksum.hexdigest
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
def verify_iso(options)
|
67
|
+
filename=self.iso_file
|
68
|
+
full_path=File.join(env.config.veewee.iso_dir,filename)
|
69
|
+
|
70
|
+
if File.exists?(full_path)
|
71
|
+
env.ui.info ""
|
72
|
+
env.ui.info "The isofile #{filename} already exists."
|
73
|
+
else
|
74
|
+
|
75
|
+
path1=Pathname.new(full_path)
|
76
|
+
path2=Pathname.new(Dir.pwd)
|
77
|
+
rel_path=path1.relative_path_from(path2).to_s
|
78
|
+
|
79
|
+
env.ui.info ""
|
80
|
+
env.ui.info "We did not find an isofile in <currentdir>/iso. \n\nThe definition provided the following download information:"
|
81
|
+
unless "#{self.iso_src}"==""
|
82
|
+
env.ui.info "- Download url: #{self.iso_src}"
|
83
|
+
end
|
84
|
+
env.ui.info "- Md5 Checksum: #{self.iso_md5}"
|
85
|
+
env.ui.info "#{self.iso_download_instructions}"
|
86
|
+
env.ui.info ""
|
87
|
+
|
88
|
+
if self.iso_src == ""
|
89
|
+
env.ui.info "Please follow the instructions above:"
|
90
|
+
env.ui.info "- to get the ISO"
|
91
|
+
env.ui.info" - put it in <currentdir>/iso"
|
92
|
+
env.ui.info "- then re-run the command"
|
93
|
+
env.ui.info ""
|
94
|
+
raise Veewee::Error, "No ISO src is available, can't download it automatically"
|
95
|
+
else
|
96
|
+
answer=nil
|
97
|
+
answer="yes" if options["auto"]==true
|
98
|
+
env.logger.info "Auto download enabled?#{answer} #{!options['auto'].nil?}"
|
99
|
+
if answer.nil?
|
100
|
+
answer=env.ui.ask("Download? (Yes/No)") {|q| q.default="No"}
|
101
|
+
end
|
102
|
+
|
103
|
+
if answer.downcase == "yes"
|
104
|
+
begin
|
105
|
+
download_iso(self.iso_src,filename)
|
106
|
+
rescue OpenURI::HTTPError => ex
|
107
|
+
env.ui.error "There was an error downloading #{self.iso_src}:"
|
108
|
+
env.ui.error "#{ex}"
|
109
|
+
raise Veewee::Error, "There was an error downloading #{self.iso_src}:\n#{ex}"
|
110
|
+
end
|
111
|
+
else
|
112
|
+
env.ui.info "You have selected manual download: "
|
113
|
+
env.ui.info "curl -C - -L '#{self.iso_src}' -o '#{rel_path}'"
|
114
|
+
env.ui.info "md5 '#{rel_path}' "
|
115
|
+
env.ui.info ""
|
116
|
+
exit
|
117
|
+
end
|
118
|
+
|
119
|
+
unless File.readable?(full_path)
|
120
|
+
raise Veewee::Error, "The provided iso #{full_path} is not readable"
|
121
|
+
end
|
122
|
+
|
123
|
+
env.ui.info "Verifying md5 checksum : #{self.iso_md5}"
|
124
|
+
file_md5=hashsum(full_path)
|
125
|
+
|
126
|
+
unless file_md5==self.iso_md5
|
127
|
+
env.ui.error "The MD5 checksums for file #{filename } do not match: "
|
128
|
+
env.ui.error "- #{file_md5} (current) vs #{self.iso_md5} (specified)"
|
129
|
+
raise Veewee::Error, "The MD5 checksums for file #{filename } do not match: \n"+ "- #{file_md5} (current) vs #{self.iso_md5} (specified)"
|
130
|
+
end
|
131
|
+
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
137
|
+
end #Module
|
138
|
+
|
139
|
+
end #Module
|
140
|
+
end #Module
|
141
|
+
end #Module
|
142
|
+
end #Module
|
@@ -0,0 +1,114 @@
|
|
1
|
+
module Veewee
|
2
|
+
module Provider
|
3
|
+
module Core
|
4
|
+
module Helper
|
5
|
+
class Scancode
|
6
|
+
|
7
|
+
def self.string_to_keycode(thestring)
|
8
|
+
|
9
|
+
#http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html
|
10
|
+
|
11
|
+
k=Hash.new
|
12
|
+
k['1'] = '02 82' ; k['2'] = '03 83' ; k['3'] = '04 84'; k['4']= '05 85' ;
|
13
|
+
k['5']='06 86'; k['6'] = '07 87' ; k['7'] = '08 88'; k['8'] = '09 89'; k['9']= '0a 8a';
|
14
|
+
k['0']='0b 8b'; k['-'] = '0c 8c'; k['='] = '0d 8d' ;
|
15
|
+
k['Tab'] = '0f 8f';
|
16
|
+
k['q'] = '10 90' ; k['w'] = '11 91' ; k['e'] = '12 92';
|
17
|
+
k['r'] = '13 93' ; k['t'] = '14 94' ; k['y'] = '15 95';
|
18
|
+
k['u']= '16 96' ; k['i']='17 97'; k['o'] = '18 98' ; k['p'] = '19 99' ;
|
19
|
+
|
20
|
+
k['Q'] = '2a 10 aa' ; k['W'] = '2a 11 aa' ; k['E'] = '2a 12 aa'; k['R'] = '2a 13 aa' ; k['T'] = '2a 14 aa' ; k['Y'] = '2a 15 aa'; k['U']= '2a 16 aa' ; k['I']='2a 17 aa'; k['O'] = '2a 18 aa' ; k['P'] = '2a 19 aa' ;
|
21
|
+
|
22
|
+
k['a'] = '1e 9e'; k['s'] = '1f 9f' ; k['d'] = '20 a0' ; k['f'] = '21 a1'; k['g'] = '22 a2' ; k['h'] = '23 a3' ; k['j'] = '24 a4';
|
23
|
+
k['k']= '25 a5' ; k['l']='26 a6';
|
24
|
+
k['A'] = '2a 1e aa 9e'; k['S'] = '2a 1f aa 9f' ; k['D'] = '2a 20 aa a0' ; k['F'] = '2a 21 aa a1';
|
25
|
+
k['G'] = '2a 22 aa a2' ; k['H'] = '2a 23 aa a3' ; k['J'] = '2a 24 aa a4'; k['K']= '2a 25 aa a5' ; k['L']='2a 26 aa a6';
|
26
|
+
|
27
|
+
k[';'] = '27 a7' ;k['"']='2a 28 aa a8';k['\'']='28 a8';
|
28
|
+
|
29
|
+
k['\\'] = '2b ab'; k['|'] = '2a 2b aa 8b';
|
30
|
+
|
31
|
+
k['[']='1a 9a'; k[']']='1b 9b';
|
32
|
+
k['<']='2a 33 aa b3'; k['>']='2a 34 aa b4';
|
33
|
+
k['$']='2a 05 aa 85';
|
34
|
+
k['+']='2a 0d aa 8d';
|
35
|
+
|
36
|
+
k['?']='2a 35 aa b5';
|
37
|
+
k['z'] = '2c ac'; k['x'] = '2d ad' ; k['c'] = '2e ae' ; k['v'] = '2f af'; k['b'] = '30 b0' ; k['n'] = '31 b1' ;
|
38
|
+
k['m'] = '32 b2';
|
39
|
+
k['Z'] = '2a 2c aa ac'; k['X'] = '2a 2d aa ad' ; k['C'] = '2a 2e aa ae' ; k['V'] = '2a 2f aa af';
|
40
|
+
k['B'] = '2a 30 aa b0' ; k['N'] = '2a 31 aa b1' ; k['M'] = '2a 32 aa b2';
|
41
|
+
|
42
|
+
k[',']= '33 b3' ; k['.']='34 b4'; k['/'] = '35 b5' ;k[':'] = '2a 27 aa a7';
|
43
|
+
k['%'] = '2a 06 aa 86'; k['_'] = '2a 0c aa 8c';
|
44
|
+
k['&'] = '2a 08 aa 88';
|
45
|
+
k['('] = '2a 0a aa 8a';
|
46
|
+
k[')'] = '2a 0b aa 8b';
|
47
|
+
|
48
|
+
|
49
|
+
special=Hash.new;
|
50
|
+
special['<Enter>'] = '1c 9c';
|
51
|
+
special['<Backspace>'] = '0e 8e';
|
52
|
+
special['<Spacebar>'] = '39 b9';
|
53
|
+
special['<Return>'] = '1c 9c'
|
54
|
+
special['<Esc>'] = '01 81';
|
55
|
+
special['<Tab>'] = '0f 8f';
|
56
|
+
special['<KillX>'] = '1d 38 0e';
|
57
|
+
special['<Wait>'] = 'wait';
|
58
|
+
|
59
|
+
special['<Up>'] = '48 c8';
|
60
|
+
special['<Down>'] = '50 d0';
|
61
|
+
special['<PageUp>'] = '49 c9';
|
62
|
+
special['<PageDown>'] = '51 d1';
|
63
|
+
special['<End>'] = '4f cf';
|
64
|
+
special['<Insert>'] = '52 d2';
|
65
|
+
special['<Delete>'] = '53 d3';
|
66
|
+
special['<Left>'] = '4b cb';
|
67
|
+
special['<Right>'] = '4d cd';
|
68
|
+
special['<Home>'] = '47 c7';
|
69
|
+
|
70
|
+
special['<F1>'] = '3b';
|
71
|
+
special['<F2>'] = '3c';
|
72
|
+
special['<F3>'] = '3d';
|
73
|
+
special['<F4>'] = '3e';
|
74
|
+
special['<F5>'] = '3f';
|
75
|
+
special['<F6>'] = '40';
|
76
|
+
special['<F7>'] = '41';
|
77
|
+
special['<F8>'] = '42';
|
78
|
+
special['<F9>'] = '43';
|
79
|
+
special['<F10>'] = '44';
|
80
|
+
|
81
|
+
keycodes=''
|
82
|
+
thestring.gsub!(/ /,"<Spacebar>")
|
83
|
+
|
84
|
+
until thestring.length == 0
|
85
|
+
nospecial=true;
|
86
|
+
special.keys.each { |key|
|
87
|
+
if thestring.start_with?(key)
|
88
|
+
#take thestring
|
89
|
+
#check if it starts with a special key + pop special string
|
90
|
+
keycodes=keycodes+special[key]+' ';
|
91
|
+
thestring=thestring.slice(key.length,thestring.length-key.length)
|
92
|
+
nospecial=false;
|
93
|
+
break;
|
94
|
+
end
|
95
|
+
}
|
96
|
+
if nospecial
|
97
|
+
code=k[thestring.slice(0,1)]
|
98
|
+
if !code.nil?
|
99
|
+
keycodes=keycodes+code+' '
|
100
|
+
else
|
101
|
+
env.ui.info "no scan code for #{thestring.slice(0,1)}"
|
102
|
+
end
|
103
|
+
#pop one
|
104
|
+
thestring=thestring.slice(1,thestring.length-1)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
return keycodes
|
109
|
+
end
|
110
|
+
end #Class
|
111
|
+
end #Module
|
112
|
+
end #Module
|
113
|
+
end #Module
|
114
|
+
end #Module
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module Veewee
|
2
|
+
module Provider
|
3
|
+
module Core
|
4
|
+
module Helper
|
5
|
+
|
6
|
+
class ShellResult
|
7
|
+
attr_accessor :stdout
|
8
|
+
attr_accessor :stderr
|
9
|
+
attr_accessor :status
|
10
|
+
|
11
|
+
def initialize(stdout,stderr,status)
|
12
|
+
@stdout=stdout
|
13
|
+
@stderr=stderr
|
14
|
+
@status=status
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module Shell
|
19
|
+
|
20
|
+
# http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/185404
|
21
|
+
# This should work on windows too now
|
22
|
+
# This will result in a ShellResult structure with stdout, stderr and status
|
23
|
+
def shell_exec(command,options = {:mute => true,:status => 0})
|
24
|
+
defaults={:mute => true, :status => 0}
|
25
|
+
options=defaults.merge(options)
|
26
|
+
result=ShellResult.new("","",-1)
|
27
|
+
env.ui.info "Executing #{command}" unless options[:mute]
|
28
|
+
env.logger.debug "Command: \"#{command}\""
|
29
|
+
env.logger.debug "Output:"
|
30
|
+
env.logger.debug "-------"
|
31
|
+
escaped_command=command
|
32
|
+
IO.popen("#{escaped_command}"+ " 2>&1") { |p|
|
33
|
+
p.each_line{ |l|
|
34
|
+
result.stdout+=l
|
35
|
+
env.ui.info(l,{:new_line => false}) unless options[:mute]
|
36
|
+
env.logger.debug(l.chomp)
|
37
|
+
}
|
38
|
+
result.status=Process.waitpid2(p.pid)[1].exitstatus
|
39
|
+
if result.status.to_i!=options[:status]
|
40
|
+
env.ui.error "Error: We executed a shell command and the exit status was not #{options[:status]}"
|
41
|
+
env.ui.error "- Command :#{command}."
|
42
|
+
env.ui.error "- Exitcode :#{result.status}."
|
43
|
+
env.ui.error "- Output :\n#{result.stdout}"
|
44
|
+
raise Veewee::Error,"Wrong exit code for command #{command}"
|
45
|
+
end
|
46
|
+
}
|
47
|
+
return result
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
end #Module
|
52
|
+
end #Module
|
53
|
+
end #Module
|
54
|
+
end #Module
|
55
|
+
end #Module
|