veewee 0.2.3 → 0.3.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +1 -2
- data/Gemfile.lock +53 -30
- data/License +21 -0
- data/README-LIB.md +2 -0
- data/README.md +35 -62
- data/Rakefile +54 -88
- data/bin/veewee +13 -70
- data/bin/veewee-kvm-old +34 -0
- data/bin/veewee-vagrant +55 -0
- data/bin/veewee-vmfusion +34 -0
- data/lib/fission.rb +41 -0
- data/lib/fission/cli.rb +76 -0
- data/lib/fission/command.rb +15 -0
- data/lib/fission/command/clone.rb +68 -0
- data/lib/fission/command/delete.rb +71 -0
- data/lib/fission/command/snapshot_create.rb +52 -0
- data/lib/fission/command/snapshot_list.rb +45 -0
- data/lib/fission/command/snapshot_revert.rb +54 -0
- data/lib/fission/command/start.rb +69 -0
- data/lib/fission/command/status.rb +31 -0
- data/lib/fission/command/stop.rb +49 -0
- data/lib/fission/command/suspend.rb +67 -0
- data/lib/fission/config.rb +29 -0
- data/lib/fission/core_ext/class.rb +5 -0
- data/lib/fission/core_ext/file.rb +7 -0
- data/lib/fission/core_ext/object.rb +112 -0
- data/lib/fission/error.rb +9 -0
- data/lib/fission/fusion.rb +17 -0
- data/lib/fission/leasesfile.rb +74 -0
- data/lib/fission/metadata.rb +39 -0
- data/lib/fission/response.rb +16 -0
- data/lib/fission/ui.rb +22 -0
- data/lib/fission/version.rb +3 -0
- data/lib/fission/vm.rb +361 -0
- data/lib/net/vnc/vnc.rb +341 -0
- data/lib/vagrant_init.rb +5 -2
- data/lib/veewee.rb +20 -3
- data/lib/veewee/builder/core/box.rb +32 -0
- data/lib/veewee/builder/core/box/vnc.rb +122 -0
- data/lib/veewee/builder/core/builder.rb +90 -0
- data/lib/veewee/builder/core/builder/build.rb +250 -0
- data/lib/veewee/builder/core/builder/iso.rb +120 -0
- data/lib/veewee/builder/core/builder/transaction.rb +25 -0
- data/lib/veewee/builder/core/builder/tunnel.rb +46 -0
- data/lib/veewee/builder/kvm/box.rb +130 -0
- data/lib/veewee/builder/kvm/builder.rb +38 -0
- data/lib/veewee/builder/virtualbox/box.rb +121 -0
- data/lib/veewee/builder/virtualbox/builder.rb +48 -0
- data/lib/veewee/builder/virtualbox/helper/_snapshots.rb +105 -0
- data/lib/veewee/builder/virtualbox/helper/_transaction.rb +135 -0
- data/lib/veewee/builder/virtualbox/helper/console_type.rb +62 -0
- data/lib/veewee/builder/virtualbox/helper/create.rb +210 -0
- data/lib/veewee/builder/virtualbox/helper/destroy.rb +79 -0
- data/lib/veewee/builder/virtualbox/helper/export_vagrant.rb +87 -0
- data/lib/veewee/builder/virtualbox/helper/validate_vagrant.rb +35 -0
- data/lib/veewee/builder/vmfusion/box.rb +137 -0
- data/lib/veewee/builder/vmfusion/builder.rb +78 -0
- data/lib/veewee/builder/vmfusion/helper/create.rb +68 -0
- data/lib/veewee/builder/vmfusion/helper/export_ova.rb +26 -0
- data/lib/veewee/builder/vmfusion/helper/template.rb +39 -0
- data/lib/veewee/builder/vmfusion/helper/template.vmx.erb +81 -0
- data/lib/veewee/builder/vmfusion/helper/validate_vmfusion.rb +37 -0
- data/lib/veewee/builder/vmfusion/info/export_ovf.info +103 -0
- data/lib/veewee/cli.rb +55 -0
- data/lib/veewee/command.rb +10 -20
- data/lib/veewee/command/base.rb +106 -0
- data/lib/veewee/command/group_base.rb +107 -0
- data/lib/veewee/command/helpers.rb +13 -0
- data/lib/veewee/command/kvm.rb +85 -0
- data/lib/veewee/command/named_base.rb +14 -0
- data/lib/veewee/command/vagrant.rb +108 -0
- data/lib/veewee/command/version.rb +13 -0
- data/lib/veewee/command/virtualbox.rb +86 -0
- data/lib/veewee/command/vmfusion.rb +113 -0
- data/lib/veewee/config.rb +89 -3
- data/lib/veewee/config/builders.rb +36 -0
- data/lib/veewee/config/collection.rb +82 -0
- data/lib/veewee/config/component.rb +19 -0
- data/lib/veewee/config/definition.rb +44 -0
- data/lib/veewee/config/ostypes.yml +165 -0
- data/lib/veewee/config/veewee.rb +21 -0
- data/lib/veewee/definition.rb +130 -0
- data/lib/veewee/environment.rb +367 -0
- data/lib/veewee/error.rb +20 -0
- data/lib/veewee/templates/locales/en.yml +30 -0
- data/lib/veewee/ui.rb +83 -0
- data/lib/veewee/util/scancode.rb +112 -0
- data/lib/veewee/util/shell.rb +42 -0
- data/lib/veewee/util/ssh.rb +158 -0
- data/lib/veewee/util/tcp.rb +88 -0
- data/lib/veewee/util/web.rb +63 -0
- data/lib/veewee/vagrant/config.rb +7 -0
- data/lib/veewee/version.rb +6 -1
- data/templates/CentOS-4.8-i386/definition.rb +3 -3
- data/templates/CentOS-4.8-i386/postinstall.sh +2 -2
- 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 +3 -3
- data/templates/CentOS-5.6-i386-netboot/ks.cfg +2 -2
- data/templates/CentOS-5.6-i386-netboot/postinstall.sh +2 -2
- data/templates/CentOS-5.6-i386/definition.rb +2 -2
- data/templates/CentOS-5.6-i386/postinstall.sh +2 -2
- data/templates/CentOS-5.6-x86_64-netboot/definition.rb +3 -3
- 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/definition.rb +2 -2
- data/templates/CentOS-6.0-i386-netboot/postinstall.sh +2 -2
- data/templates/CentOS-6.0-i386/definition.rb +2 -2
- data/templates/CentOS-6.0-i386/postinstall.sh +2 -2
- data/templates/CentOS-6.0-x86_64-minimal/definition.rb +2 -2
- data/templates/CentOS-6.0-x86_64-minimal/postinstall.sh +4 -17
- data/templates/CentOS-6.0-x86_64-netboot/definition.rb +2 -2
- data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +2 -2
- data/templates/CentOS-6.0-x86_64/definition.rb +2 -2
- data/templates/CentOS-6.0-x86_64/postinstall.sh +2 -2
- data/templates/Debian-5.0.8-amd64-netboot/definition.rb +1 -1
- data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +1 -1
- data/templates/Debian-5.0.8-i386-netboot/definition.rb +1 -1
- data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +1 -1
- data/templates/{Debian-6.0.3-amd64-netboot → Debian-6.0.2-amd64-netboot}/definition.rb +4 -4
- data/templates/{ubuntu-11.10-server-amd64-ishaya → Debian-6.0.2-amd64-netboot}/postinstall.sh +23 -42
- data/templates/{Debian-6.0.3-amd64-netboot → Debian-6.0.2-amd64-netboot}/preseed.cfg +0 -0
- data/templates/{Debian-6.0.3-i386-netboot → Debian-6.0.2-i386-netboot}/definition.rb +4 -4
- data/templates/{Debian-6.0.3-i386-netboot → Debian-6.0.2-i386-netboot}/postinstall.sh +1 -1
- data/templates/{Debian-6.0.3-i386-netboot → Debian-6.0.2-i386-netboot}/preseed.cfg +0 -0
- data/templates/Fedora-14-amd64-netboot/definition.rb +2 -2
- data/templates/Fedora-14-amd64-netboot/postinstall.sh +2 -2
- data/templates/Fedora-14-amd64/definition.rb +2 -2
- data/templates/Fedora-14-amd64/postinstall.sh +2 -2
- data/templates/Fedora-14-i386-netboot/definition.rb +2 -2
- data/templates/Fedora-14-i386-netboot/postinstall.sh +2 -2
- data/templates/Fedora-14-i386/definition.rb +2 -2
- data/templates/Fedora-14-i386/postinstall.sh +2 -2
- data/templates/Fedora-15-i386-netboot/definition.rb +2 -2
- data/templates/Fedora-15-i386/definition.rb +3 -3
- data/templates/Sysrescuecd-2.0.0-experimental/definition.rb +1 -1
- data/templates/archlinux-i386-netboot/aif.cfg +14 -8
- data/templates/archlinux-i386-netboot/definition.rb +7 -4
- data/templates/archlinux-i386-netboot/postinstall.sh +17 -5
- data/templates/archlinux-i386-netboot/postinstall2.sh +1 -3
- data/templates/archlinux-i386/definition.rb +4 -4
- data/templates/archlinux-i386/postinstall.sh +1 -1
- data/templates/archlinux-x86_64-netboot/aif.cfg +14 -8
- data/templates/archlinux-x86_64-netboot/definition.rb +7 -4
- data/templates/archlinux-x86_64-netboot/postinstall.sh +16 -1
- data/templates/archlinux-x86_64-netboot/postinstall2.sh +1 -3
- data/templates/archlinux-x86_64/definition.rb +2 -2
- data/templates/archlinux-x86_64/postinstall.sh +1 -1
- data/templates/freebsd-8.2-experimental/definition.rb +1 -1
- data/templates/freebsd-8.2-pcbsd-i386-netboot/definition.rb +2 -5
- data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +1 -1
- data/templates/freebsd-8.2-pcbsd-i386/definition.rb +3 -4
- data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +1 -1
- data/templates/gentoo-latest-i386-experimental/definition.rb +7 -7
- data/templates/gentoo-latest-i386-experimental/postinstall.sh +1 -1
- data/templates/openSUSE-11.4-DVD-i586/postinstall.sh +1 -1
- data/templates/openSUSE-11.4-DVD-x86_64/postinstall.sh +1 -1
- data/templates/openSUSE-11.4-NET-i586/postinstall.sh +1 -1
- data/templates/openSUSE-11.4-NET-x86_64/postinstall.sh +1 -1
- data/templates/openindiana-148-ai-x86/definition.rb +3 -3
- data/templates/openindiana-148-ai-x86/postinstall.sh +1 -1
- data/templates/opensuse-11.4-i386-experimental/definition.rb +1 -1
- data/templates/opensuse-11.4-i386-experimental/postinstall.sh +1 -1
- data/templates/solaris-11-express-i386/definition.rb +3 -3
- data/templates/solaris-11-express-i386/postinstall.sh +1 -1
- data/templates/ubuntu-10.04.2-amd64-netboot/definition.rb +1 -1
- data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +1 -1
- data/templates/ubuntu-10.04.2-server-i386-netboot/definition.rb +1 -1
- data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +1 -1
- data/templates/ubuntu-10.04.3-server-amd64-alt/definition.rb +6 -6
- data/templates/ubuntu-10.04.3-server-amd64-alt/postinstall.sh +1 -1
- data/templates/ubuntu-10.04.3-server-amd64/base.sh +11 -0
- data/templates/ubuntu-10.04.3-server-amd64/chef.sh +2 -0
- data/templates/ubuntu-10.04.3-server-amd64/cleanup.sh +19 -0
- data/templates/ubuntu-10.04.3-server-amd64/definition.rb +19 -11
- data/templates/ubuntu-10.04.3-server-amd64/preseed.cfg +4 -4
- data/templates/ubuntu-10.04.3-server-amd64/puppet.sh +1 -0
- data/templates/ubuntu-10.04.3-server-amd64/ruby.sh +24 -0
- data/templates/ubuntu-10.04.3-server-amd64/vagrant.sh +27 -0
- data/templates/ubuntu-10.04.3-server-amd64/virtualbox.sh +12 -0
- data/templates/ubuntu-10.04.3-server-i386/postinstall.sh +1 -1
- data/templates/ubuntu-10.10-server-amd64-netboot/definition.rb +1 -1
- data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +1 -1
- data/templates/ubuntu-10.10-server-amd64/base.sh +11 -0
- data/templates/ubuntu-10.10-server-amd64/chef.sh +2 -0
- data/templates/ubuntu-10.10-server-amd64/cleanup.sh +19 -0
- data/templates/ubuntu-10.10-server-amd64/definition.rb +20 -8
- data/templates/ubuntu-10.10-server-amd64/postinstall.sh +1 -1
- data/templates/ubuntu-10.10-server-amd64/preseed.cfg +5 -5
- data/templates/ubuntu-10.10-server-amd64/puppet.sh +1 -0
- data/templates/ubuntu-10.10-server-amd64/ruby.sh +24 -0
- data/templates/ubuntu-10.10-server-amd64/vagrant.sh +27 -0
- data/templates/ubuntu-10.10-server-amd64/virtualbox.sh +12 -0
- data/templates/ubuntu-10.10-server-i386-netboot/definition.rb +1 -1
- data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +1 -1
- data/templates/ubuntu-10.10-server-i386/definition.rb +1 -1
- data/templates/ubuntu-10.10-server-i386/postinstall.sh +1 -1
- data/templates/ubuntu-11.04-server-amd64/apt-upgrade.sh +4 -0
- data/templates/ubuntu-11.04-server-amd64/chef.sh +1 -0
- data/templates/ubuntu-11.04-server-amd64/definition.rb +32 -9
- data/templates/ubuntu-11.04-server-amd64/network-cleanup.sh +14 -0
- data/templates/ubuntu-11.04-server-amd64/nfs-client.sh +3 -0
- data/templates/ubuntu-11.04-server-amd64/puppet.sh +1 -0
- data/templates/ubuntu-11.04-server-amd64/remove-build-essentials.sh +3 -0
- data/templates/ubuntu-11.04-server-amd64/ruby.sh +29 -0
- data/templates/ubuntu-11.04-server-amd64/ssh-keys.sh +7 -0
- data/templates/ubuntu-11.04-server-amd64/sudo.sh +4 -0
- data/templates/ubuntu-11.04-server-amd64/timestamp.sh +1 -0
- data/templates/ubuntu-11.04-server-amd64/vbox_additions.sh +11 -0
- data/templates/ubuntu-11.04-server-amd64/zero-disk.sh +3 -0
- data/templates/ubuntu-11.04-server-i386/definition.rb +2 -2
- data/templates/ubuntu-11.04-server-i386/postinstall.sh +1 -1
- data/templates/ubuntu-8.04.4-server-amd64/definition.rb +1 -2
- data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +7 -8
- data/templates/ubuntu-8.04.4-server-amd64/preseed.cfg +1 -0
- data/templates/ubuntu-8.04.4-server-i386/definition.rb +2 -2
- data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +3 -25
- data/templates/windows-2008R2-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R2-amd64/definition.rb +1 -1
- data/templates/windows-2008R2-amd64/install-winrm.bat +0 -2
- data/templates/windows-2008R2-amd64/postinstall.sh +1 -1
- data/templates/windows-2008R2-amd64/win7/Autounattend.xml +180 -0
- data/test/build_test.rb +50 -0
- data/test/definition_test.rb +11 -0
- data/test/definitions/test_definition/_test_me.sh +1 -0
- data/test/definitions/test_definition/autorun0 +3 -0
- data/test/definitions/test_definition/definition.rb +27 -0
- data/test/environment_test.rb +67 -0
- data/validation/features/steps/ssh_steps.rb +52 -52
- data/validation/vagrant.feature +64 -48
- data/veewee.gemspec +14 -9
- metadata +243 -213
- data/lib/veewee/command/basebox.rb +0 -63
- data/lib/veewee/command/basebox_build.rb +0 -32
- data/lib/veewee/command/basebox_define.rb +0 -28
- data/lib/veewee/command/basebox_destroy.rb +0 -22
- data/lib/veewee/command/basebox_export.rb +0 -22
- data/lib/veewee/command/basebox_list.rb +0 -23
- data/lib/veewee/command/basebox_ostypes.rb +0 -23
- data/lib/veewee/command/basebox_templates.rb +0 -23
- data/lib/veewee/command/basebox_undefine.rb +0 -22
- data/lib/veewee/command/basebox_validate.rb +0 -26
- data/lib/veewee/export.rb +0 -81
- data/lib/veewee/scancode.rb +0 -151
- data/lib/veewee/session.rb +0 -907
- data/lib/veewee/shell.rb +0 -54
- data/lib/veewee/ssh.rb +0 -193
- data/lib/veewee/transaction.rb +0 -122
- data/lib/veewee/utils.rb +0 -26
- data/lib/veewee/web.rb +0 -48
- data/templates/CentOS-6.1-x86_64-minimal/definition.rb +0 -15
- data/templates/CentOS-6.1-x86_64-minimal/ks.cfg +0 -37
- data/templates/CentOS-6.1-x86_64-minimal/postinstall.sh +0 -50
- data/templates/CentOS-6.2-x86_64-minimal/definition.rb +0 -15
- data/templates/CentOS-6.2-x86_64-minimal/ks.cfg +0 -37
- data/templates/CentOS-6.2-x86_64-minimal/postinstall.sh +0 -50
- data/templates/Debian-6.0.3-amd64-netboot/postinstall.sh +0 -80
- data/templates/Fedora-15-x86_64-netboot/definition.rb +0 -29
- data/templates/Fedora-15-x86_64-netboot/ks.cfg +0 -64
- data/templates/Fedora-15-x86_64-netboot/postinstall.sh +0 -33
- data/templates/Fedora-16-i386/definition.rb +0 -17
- data/templates/Fedora-16-i386/ks.cfg +0 -72
- data/templates/Fedora-16-i386/postinstall.sh +0 -35
- data/templates/Fedora-16-x86_64/definition.rb +0 -17
- data/templates/Fedora-16-x86_64/ks.cfg +0 -72
- data/templates/Fedora-16-x86_64/postinstall.sh +0 -35
- data/templates/SLES-11-SP1-DVD-i586-GM/autoinst_de.xml +0 -1127
- data/templates/SLES-11-SP1-DVD-i586-GM/autoinst_en.xml +0 -1127
- data/templates/SLES-11-SP1-DVD-i586-GM/definition.rb +0 -37
- data/templates/SLES-11-SP1-DVD-i586-GM/postinstall.sh +0 -43
- data/templates/SLES-11-SP1-DVD-x86_64-GM/autoinst_de.xml +0 -1171
- data/templates/SLES-11-SP1-DVD-x86_64-GM/autoinst_en.xml +0 -1171
- data/templates/SLES-11-SP1-DVD-x86_64-GM/definition.rb +0 -37
- data/templates/SLES-11-SP1-DVD-x86_64-GM/postinstall.sh +0 -43
- data/templates/funtoo-latest-generic_64-stable/definition.rb +0 -34
- data/templates/funtoo-latest-generic_64-stable/postinstall.sh +0 -177
- data/templates/funtoo-latest-generic_64-stable/postinstall2.sh +0 -83
- data/templates/gentoo-latest-x86_64-experimental/definition.rb +0 -34
- data/templates/gentoo-latest-x86_64-experimental/postinstall.sh +0 -214
- data/templates/openSUSE-12.1-DVD+NET-i586/autoinst_de.xml +0 -1483
- data/templates/openSUSE-12.1-DVD+NET-i586/autoinst_en.xml +0 -1483
- data/templates/openSUSE-12.1-DVD+NET-i586/definition.rb +0 -44
- data/templates/openSUSE-12.1-DVD+NET-i586/postinstall.sh +0 -43
- data/templates/openSUSE-12.1-DVD+NET-x86_64/autoinst_de.xml +0 -1727
- data/templates/openSUSE-12.1-DVD+NET-x86_64/autoinst_en.xml +0 -1727
- data/templates/openSUSE-12.1-DVD+NET-x86_64/definition.rb +0 -44
- data/templates/openSUSE-12.1-DVD+NET-x86_64/postinstall.sh +0 -43
- data/templates/openbsd50_amd64/README +0 -28
- data/templates/openbsd50_amd64/definition.rb +0 -84
- data/templates/openbsd50_amd64/postinstall.sh +0 -81
- data/templates/openbsd50_i386/.definition.rb.swp +0 -0
- data/templates/openbsd50_i386/README +0 -28
- data/templates/openbsd50_i386/definition.rb +0 -84
- data/templates/openbsd50_i386/postinstall.sh +0 -80
- data/templates/scientificlinux-6.1-i386-netboot/definition.rb +0 -16
- data/templates/scientificlinux-6.1-i386-netboot/ks.cfg +0 -53
- data/templates/scientificlinux-6.1-i386-netboot/postinstall.sh +0 -30
- data/templates/scientificlinux-6.1-x86_64-netboot/definition.rb +0 -16
- data/templates/scientificlinux-6.1-x86_64-netboot/ks.cfg +0 -53
- data/templates/scientificlinux-6.1-x86_64-netboot/postinstall.sh +0 -30
- data/templates/ubuntu-10.04.3-server-amd64/postinstall.sh +0 -90
- data/templates/ubuntu-11.04-server-amd64/postinstall.sh +0 -96
- data/templates/ubuntu-11.10-server-amd64-ishaya/definition.rb +0 -24
- data/templates/ubuntu-11.10-server-amd64-ishaya/preseed.cfg +0 -87
- data/templates/ubuntu-11.10-server-amd64-ruby192/definition.rb +0 -24
- data/templates/ubuntu-11.10-server-amd64-ruby192/postinstall.sh +0 -90
- data/templates/ubuntu-11.10-server-amd64-ruby192/preseed.cfg +0 -87
- data/templates/ubuntu-11.10-server-amd64/definition.rb +0 -35
- data/templates/ubuntu-11.10-server-amd64/postinstall.sh +0 -88
- data/templates/ubuntu-11.10-server-amd64/preseed.cfg +0 -87
- data/templates/ubuntu-11.10-server-i386/definition.rb +0 -35
- data/templates/ubuntu-11.10-server-i386/postinstall.sh +0 -88
- data/templates/ubuntu-11.10-server-i386/preseed.cfg +0 -87
- data/templates/windows-2008R1-serverstandard-amd64/Autounattend.xml +0 -146
- data/templates/windows-2008R1-serverstandard-amd64/README.md +0 -134
- data/templates/windows-2008R1-serverstandard-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-2008R1-serverstandard-amd64/definition.rb +0 -114
- data/templates/windows-2008R1-serverstandard-amd64/install-cygwin-sshd.bat +0 -40
- data/templates/windows-2008R1-serverstandard-amd64/install-guest-additions.bat +0 -5
- data/templates/windows-2008R1-serverstandard-amd64/install-winrm.bat +0 -14
- data/templates/windows-2008R1-serverstandard-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R1-serverstandard-amd64/postinstall.sh +0 -74
- data/templates/windows-2008R1-serverstandard-amd64/sudo +0 -2
- data/templates/windows-2008R1-serverstandard-amd64/winrm.rb +0 -8
- data/templates/windows-2008R2-serverstandard-amd64/Autounattend.xml +0 -147
- data/templates/windows-2008R2-serverstandard-amd64/README.md +0 -142
- data/templates/windows-2008R2-serverstandard-amd64/definition.rb +0 -44
- data/templates/windows-2008R2-serverstandard-amd64/install-cygwin-sshd.bat +0 -41
- data/templates/windows-2008R2-serverstandard-amd64/install-winrm.bat +0 -11
- data/templates/windows-2008R2-serverstandard-amd64/oracle-cert.cer +0 -0
- data/templates/windows-2008R2-serverstandard-amd64/postinstall.sh +0 -74
- data/templates/windows-7-enterprise-amd64/Autounattend.xml +0 -149
- data/templates/windows-7-enterprise-amd64/README.md +0 -52
- data/templates/windows-7-enterprise-amd64/definition.rb +0 -39
- data/templates/windows-7-enterprise-amd64/install-cygwin-sshd.bat +0 -40
- data/templates/windows-7-enterprise-amd64/install-winrm.bat +0 -14
- data/templates/windows-7-enterprise-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-enterprise-amd64/postinstall.sh +0 -74
- data/templates/windows-7-enterprise-i386/Autounattend.xml +0 -151
- data/templates/windows-7-enterprise-i386/README.md +0 -169
- data/templates/windows-7-enterprise-i386/definition.rb +0 -40
- data/templates/windows-7-enterprise-i386/install-cygwin-sshd.bat +0 -40
- data/templates/windows-7-enterprise-i386/install-winrm.bat +0 -14
- data/templates/windows-7-enterprise-i386/oracle-cert.cer +0 -0
- data/templates/windows-7-enterprise-i386/postinstall.sh +0 -74
- data/templates/windows-7-premium-amd64/Autounattend.xml +0 -152
- data/templates/windows-7-premium-amd64/README.md +0 -171
- data/templates/windows-7-premium-amd64/definition.rb +0 -38
- data/templates/windows-7-premium-amd64/install-chefclient.bat +0 -44
- data/templates/windows-7-premium-amd64/install-winrm.bat +0 -11
- data/templates/windows-7-premium-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-premium-amd64/postinstall.sh +0 -124
- data/templates/windows-7-premium-amd64/winrm.rb +0 -8
- data/templates/windows-7-professional-amd64/Autounattend.xml +0 -152
- data/templates/windows-7-professional-amd64/README.md +0 -171
- data/templates/windows-7-professional-amd64/definition.rb +0 -41
- data/templates/windows-7-professional-amd64/install-cygwin-sshd.bat +0 -40
- data/templates/windows-7-professional-amd64/install-winrm.bat +0 -14
- data/templates/windows-7-professional-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-professional-amd64/postinstall.sh +0 -74
- data/templates/windows-7-ultimate-amd64/Autounattend.xml +0 -152
- data/templates/windows-7-ultimate-amd64/README.md +0 -89
- data/templates/windows-7-ultimate-amd64/definition.rb +0 -41
- data/templates/windows-7-ultimate-amd64/install-cygwin-sshd.bat +0 -40
- data/templates/windows-7-ultimate-amd64/install-winrm.bat +0 -14
- data/templates/windows-7-ultimate-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7-ultimate-amd64/postinstall.sh +0 -74
- data/templates/windows-7sp1-ultimate-amd64/Autounattend.xml +0 -152
- data/templates/windows-7sp1-ultimate-amd64/README.md +0 -89
- data/templates/windows-7sp1-ultimate-amd64/definition.rb +0 -42
- data/templates/windows-7sp1-ultimate-amd64/install-cygwin-sshd.bat +0 -40
- data/templates/windows-7sp1-ultimate-amd64/install-winrm.bat +0 -14
- data/templates/windows-7sp1-ultimate-amd64/oracle-cert.cer +0 -0
- data/templates/windows-7sp1-ultimate-amd64/postinstall.sh +0 -74
- data/templates/windows-8-preview-dev-amd64/Autounattend.xml +0 -140
- data/templates/windows-8-preview-dev-amd64/README.md +0 -134
- data/templates/windows-8-preview-dev-amd64/cygwin-setup.exe +0 -0
- data/templates/windows-8-preview-dev-amd64/definition.rb +0 -114
- data/templates/windows-8-preview-dev-amd64/install-cygwin-sshd.bat +0 -38
- data/templates/windows-8-preview-dev-amd64/install-winrm.bat +0 -11
- data/templates/windows-8-preview-dev-amd64/oracle-cert.cer +0 -0
- data/templates/windows-8-preview-dev-amd64/postinstall.sh +0 -122
- data/templates/windows-8-preview-dev-amd64/winrm.rb +0 -8
- data/trials/docu-vbox.txt +0 -83
- data/trials/f.rb +0 -29
- data/trials/t.rb +0 -15
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'veewee/util/tcp'
|
2
|
+
require 'veewee/util/web'
|
3
|
+
require 'veewee/util/ssh'
|
4
|
+
require 'veewee/util/shell'
|
5
|
+
|
6
|
+
|
7
|
+
require 'veewee/builder/core/builder/build.rb'
|
8
|
+
require 'veewee/builder/core/builder/iso.rb'
|
9
|
+
|
10
|
+
module Veewee
|
11
|
+
module Builder
|
12
|
+
module Core
|
13
|
+
class Builder
|
14
|
+
|
15
|
+
attr_accessor :env
|
16
|
+
attr_accessor :options
|
17
|
+
|
18
|
+
attr_accessor :type
|
19
|
+
attr_accessor :name
|
20
|
+
|
21
|
+
include ::Veewee::Builder::Core::BuilderCommand
|
22
|
+
include ::Veewee::Util::Tcp
|
23
|
+
include ::Veewee::Util::Web
|
24
|
+
include ::Veewee::Util::Ssh
|
25
|
+
include ::Veewee::Util::Shell
|
26
|
+
|
27
|
+
def initialize(name,options,env)
|
28
|
+
|
29
|
+
@env=env
|
30
|
+
@name=name
|
31
|
+
@options=options
|
32
|
+
@type=self.class.to_s.split("::")[-2]
|
33
|
+
check_requirements
|
34
|
+
end
|
35
|
+
|
36
|
+
def get_definition(name)
|
37
|
+
env.logger.info("fetching definition #{name}")
|
38
|
+
definition=env.get_definition(name)
|
39
|
+
return definition
|
40
|
+
end
|
41
|
+
|
42
|
+
def get_box(name)
|
43
|
+
begin
|
44
|
+
require_path='veewee/builder/'+type.to_s.downcase+"/box.rb"
|
45
|
+
require require_path
|
46
|
+
|
47
|
+
# Get a real box object from the builder
|
48
|
+
box=Object.const_get("Veewee").const_get("Builder").const_get(type.to_s.capitalize).const_get("Box").new(name,env)
|
49
|
+
rescue Error => ex
|
50
|
+
env.ui.error "Could not instante the box #{name} with provider #{type} ,#{ex}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.available?
|
55
|
+
begin
|
56
|
+
self.check_requirements
|
57
|
+
return true
|
58
|
+
rescue Error
|
59
|
+
return false
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def gem_available?(gemname)
|
64
|
+
env.logger.info "Checking for gem #{gemname}"
|
65
|
+
available=false
|
66
|
+
begin
|
67
|
+
available=true unless Gem::Specification::find_by_name("#{gemname}").nil?
|
68
|
+
rescue Gem::LoadError
|
69
|
+
env.logger.info "Error loading gem #{gemname}"
|
70
|
+
available=false
|
71
|
+
rescue
|
72
|
+
env.logger.info "Falling back to old syntax for #{gemname}"
|
73
|
+
available=Gem.available?("#{gemname}")
|
74
|
+
env.logger.info "Old syntax #{gemname}.available? #{available}"
|
75
|
+
end
|
76
|
+
return available
|
77
|
+
end
|
78
|
+
|
79
|
+
def gems_available?(names)
|
80
|
+
names.each do |gemname|
|
81
|
+
return false if !gem_available?(gemname)
|
82
|
+
end
|
83
|
+
return true
|
84
|
+
end
|
85
|
+
|
86
|
+
end #End Class
|
87
|
+
|
88
|
+
end #End Module
|
89
|
+
end #End Module
|
90
|
+
end #End Module
|
@@ -0,0 +1,250 @@
|
|
1
|
+
module Veewee
|
2
|
+
module Builder
|
3
|
+
module Core
|
4
|
+
module BuilderCommand
|
5
|
+
|
6
|
+
def build(definition_name,box_name,options)
|
7
|
+
|
8
|
+
definition=get_definition(definition_name)
|
9
|
+
|
10
|
+
if definition.nil?
|
11
|
+
env.ui.error "The definition #{definition_name} does not exist. Sorry"
|
12
|
+
exit -1
|
13
|
+
end
|
14
|
+
|
15
|
+
# If no box_name was given, let's give the box the same name as the definition
|
16
|
+
if box_name.nil?
|
17
|
+
box_name=definition_name
|
18
|
+
end
|
19
|
+
|
20
|
+
env.ui.info "Building #{definition_name} #{box_name} #{options}"
|
21
|
+
|
22
|
+
# Check the iso file we need to build the box
|
23
|
+
verify_iso(definition,options)
|
24
|
+
|
25
|
+
box=get_box(box_name)
|
26
|
+
|
27
|
+
if box.exists?
|
28
|
+
# check if --force option was given
|
29
|
+
if options[:force]==true
|
30
|
+
box.destroy
|
31
|
+
box.reload
|
32
|
+
else
|
33
|
+
env.ui.error "you need to provide --force because the box #{box_name} already exists"
|
34
|
+
exit -1
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# By now the box should have been gone, just checking again
|
39
|
+
if box.exists?
|
40
|
+
env.ui.error "The box should have been deleted by now. Something went terribly wrong. Sorry"
|
41
|
+
exit -1
|
42
|
+
end
|
43
|
+
|
44
|
+
# By now the machine if it existed, should have been shutdown
|
45
|
+
# The last thing to check is if the power we are supposed to ssh to, is still open
|
46
|
+
|
47
|
+
|
48
|
+
# if is_tcp_port_open?(box.ip_address, ssh_options(definition)[:port])
|
49
|
+
# env.ui.info "Hmm, the #{box.ip_address}:#{ssh_options(definition)[:port]} is open. And we shut down?"
|
50
|
+
# exit -1
|
51
|
+
# end
|
52
|
+
|
53
|
+
# Filtering post install files based upon --postinstall-include and --postinstall--exclude
|
54
|
+
definition.postinstall_files=filter_postinstall_files(definition,options)
|
55
|
+
|
56
|
+
box.create(definition)
|
57
|
+
|
58
|
+
# Check the GUI mode required
|
59
|
+
env.logger.info "Builder asks the box to start: GUI enabled? #{!options[:nogui]}"
|
60
|
+
gui_enabled=options[:nogui]==true ? false : true
|
61
|
+
box.start(gui_enabled)
|
62
|
+
|
63
|
+
# Waiting for it to boot
|
64
|
+
env.ui.info "Waiting #{definition.boot_wait.to_i} seconds for the machine to boot"
|
65
|
+
sleep definition.boot_wait.to_i
|
66
|
+
|
67
|
+
# Calculate an available kickstart port
|
68
|
+
guessed_port=guess_free_port(definition.kickstart_port.to_i,7199).to_s
|
69
|
+
if guessed_port.to_s!=definition.kickstart_port
|
70
|
+
env.ui.warn "Changing kickstart port from #{definition.kickstart_port} to #{guessed_port}"
|
71
|
+
definition.kickstart_port=guessed_port.to_s
|
72
|
+
end
|
73
|
+
|
74
|
+
# Let fill's in the variable we need
|
75
|
+
boot_sequence=fill_sequence(definition.boot_cmd_sequence,{
|
76
|
+
:ip =>get_local_ip,
|
77
|
+
:port => definition.kickstart_port.to_s,
|
78
|
+
:name => box.name
|
79
|
+
})
|
80
|
+
|
81
|
+
box.console_type(boot_sequence)
|
82
|
+
|
83
|
+
until !box.ip_address.nil?
|
84
|
+
env.logger.info "wait for Ip addres"
|
85
|
+
sleep 2
|
86
|
+
end
|
87
|
+
|
88
|
+
handle_kickstart(definition)
|
89
|
+
|
90
|
+
transfer_buildinfo(box,definition)
|
91
|
+
|
92
|
+
handle_postinstall(box,definition)
|
93
|
+
|
94
|
+
env.ui.confirm "The box #{box_name} was build succesfully!"
|
95
|
+
env.ui.info "You can now login to the box with:"
|
96
|
+
env.ui.info "\nssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p #{ssh_options(definition)[:port]} -l #{definition.ssh_user} #{box.ip_address}"
|
97
|
+
|
98
|
+
return box
|
99
|
+
end
|
100
|
+
|
101
|
+
def filter_postinstall_files(definition,options)
|
102
|
+
new_definition=definition.clone
|
103
|
+
|
104
|
+
env.logger.info "Applying the postinstall excludes"
|
105
|
+
unless options["postinstall_exclude"].nil?
|
106
|
+
options["postinstall_exclude"].each do |p|
|
107
|
+
env.logger.info "Exclude pattern #{p}"
|
108
|
+
new_definition.postinstall_files.collect! { |f| f.match(p) ? f.gsub(/^/,"_"): f}
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
env.logger.info "Applying the postinstall includes"
|
113
|
+
unless options["postinstall_include"].nil?
|
114
|
+
options["postinstall_include"].each do |p|
|
115
|
+
env.logger.info "Include pattern #{p}"
|
116
|
+
new_definition.postinstall_files.collect! { |f| f.match(p) ? f.gsub(/^_/,""): f}
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
env.logger.info "filtered postinstall files:"
|
121
|
+
new_definition.postinstall_files.each do |p|
|
122
|
+
env.logger.info "- "+p
|
123
|
+
end
|
124
|
+
|
125
|
+
return new_definition.postinstall_files
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
# This will take a sequence and fill in the variables specified in the options
|
131
|
+
# f.i. options={:ip => "name"} will substitute "%IP%" -> "name"
|
132
|
+
def fill_sequence(sequence,options)
|
133
|
+
filled=sequence.dup
|
134
|
+
options.each do |key,value|
|
135
|
+
filled.each do |s|
|
136
|
+
s.gsub!("%#{key.to_s.upcase}%",value)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
return filled
|
140
|
+
end
|
141
|
+
|
142
|
+
def build_info
|
143
|
+
[ {:filename => ".veewee_version",:content => "#{Veewee::VERSION}"}]
|
144
|
+
end
|
145
|
+
|
146
|
+
# This function handles all the post-install scripts
|
147
|
+
# It requires a definition to find all the necessary information
|
148
|
+
def handle_kickstart(definition)
|
149
|
+
|
150
|
+
# Handling the kickstart by web
|
151
|
+
kickstartfiles=definition.kickstart_file
|
152
|
+
|
153
|
+
if kickstartfiles.nil? || kickstartfiles.length == 0
|
154
|
+
env.ui.info "Skipping webserver as no kickstartfile was specified"
|
155
|
+
end
|
156
|
+
|
157
|
+
env.ui.info "Starting a webserver #{definition.kickstart_ip}:#{definition.kickstart_port}\n"
|
158
|
+
|
159
|
+
# Check if the kickstart is an array or a single string
|
160
|
+
if kickstartfiles.is_a?(String)
|
161
|
+
# Let's turn it into an array
|
162
|
+
kickstartfiles=kickstartfiles.split
|
163
|
+
end
|
164
|
+
|
165
|
+
# For each kickstart file spinup a webserver and wait for the file to be fetched
|
166
|
+
unless kickstartfiles.nil?
|
167
|
+
kickstartfiles.each do |kickfile|
|
168
|
+
wait_for_http_request(kickfile,{
|
169
|
+
:port => definition.kickstart_port,
|
170
|
+
:host => definition.kickstart_ip,
|
171
|
+
:timeout => definition.kickstart_timeout,
|
172
|
+
:web_dir => definition.path
|
173
|
+
})
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
|
179
|
+
# This function handles all the post-install scripts
|
180
|
+
# It requires a box(to login to) and a definition(listing the postinstall files)
|
181
|
+
def handle_postinstall(box,definition)
|
182
|
+
|
183
|
+
definition.postinstall_files.each do |postinstall_file|
|
184
|
+
|
185
|
+
# Filenames of postinstall_files are relative to their definition
|
186
|
+
filename=File.join(definition.path,postinstall_file)
|
187
|
+
unless File.basename(postinstall_file)=~/^_/
|
188
|
+
begin
|
189
|
+
when_ssh_login_works(box.ip_address,ssh_options(definition).merge({:timeout => definition.postinstall_timeout.to_i})) do
|
190
|
+
begin
|
191
|
+
env.logger.info "About to transfer #{filename} to the box #{box.name} - #{box.ip_address} - #{ssh_options(definition)}"
|
192
|
+
ssh_transfer_file(box.ip_address,filename,File.basename(filename),ssh_options(definition))
|
193
|
+
rescue RuntimeError => ex
|
194
|
+
env.ui.error "error transfering file #{File.basename(filename)}, possible not enough permissions to write? #{ex}"
|
195
|
+
exit -1
|
196
|
+
end
|
197
|
+
command=definition.sudo_cmd
|
198
|
+
newcommand=command.gsub(/%p/,"#{definition.ssh_password}")
|
199
|
+
newcommand.gsub!(/%u/,"#{definition.ssh_user}")
|
200
|
+
newcommand.gsub!(/%f/,"#{postinstall_file}")
|
201
|
+
begin
|
202
|
+
ssh_exec(box.ip_address,"#{newcommand}",ssh_options(definition))
|
203
|
+
rescue RuntimeError => ex
|
204
|
+
env.ui.error "Error executing the command #{newcommand}: #{ex}"
|
205
|
+
exit -1
|
206
|
+
end
|
207
|
+
end
|
208
|
+
rescue Net::SSH::AuthenticationFailed
|
209
|
+
env.ui.error "Authentication failure"
|
210
|
+
exit -1
|
211
|
+
end
|
212
|
+
else
|
213
|
+
env.logger.info "Skipping postinstallfile #{postinstall_file}"
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
|
219
|
+
# Transfer information provide by the builder to the box
|
220
|
+
#
|
221
|
+
#
|
222
|
+
def transfer_buildinfo(box,definition)
|
223
|
+
begin
|
224
|
+
when_ssh_login_works(box.ip_address,ssh_options(definition).merge({:timeout => definition.postinstall_timeout.to_i})) do
|
225
|
+
build_info.each do |info|
|
226
|
+
begin
|
227
|
+
infofile=Tempfile.open("#{info[:filename]}")
|
228
|
+
infofile.puts "#{info[:content]}"
|
229
|
+
infofile.rewind
|
230
|
+
env.logger.info "About to transfer buildinfo #{info[:content]} into #{info[:filename]} to the box #{box.name} - #{box.ip_address} - #{ssh_options(definition)}"
|
231
|
+
ssh_transfer_file(box.ip_address,infofile.path,info[:filename],ssh_options(definition))
|
232
|
+
infofile.close
|
233
|
+
infofile.delete
|
234
|
+
rescue RuntimeError => ex
|
235
|
+
env.ui.error "Error transfering file #{info[:filename]} failed, possible not enough permissions to write? #{ex}"
|
236
|
+
exit -1
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
rescue Net::SSH::AuthenticationFailed
|
241
|
+
env.ui.error "Authentication failure"
|
242
|
+
exit -1
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
246
|
+
|
247
|
+
end #Module
|
248
|
+
end #Module
|
249
|
+
end #Module
|
250
|
+
end #Module
|
@@ -0,0 +1,120 @@
|
|
1
|
+
module Veewee
|
2
|
+
module Builder
|
3
|
+
module Core
|
4
|
+
module BuilderCommand
|
5
|
+
|
6
|
+
require 'open-uri'
|
7
|
+
require 'progressbar'
|
8
|
+
require 'highline/import'
|
9
|
+
require 'digest/md5'
|
10
|
+
|
11
|
+
def download_progress(url,localfile)
|
12
|
+
pbar = nil
|
13
|
+
URI.parse(url).open(
|
14
|
+
:content_length_proc => lambda {|t|
|
15
|
+
if t && 0 < t
|
16
|
+
pbar = ProgressBar.new("Fetching file", t)
|
17
|
+
pbar.file_transfer_mode
|
18
|
+
end
|
19
|
+
},
|
20
|
+
:progress_proc => lambda {|s|
|
21
|
+
pbar.set s if pbar
|
22
|
+
}) { |src|
|
23
|
+
open("#{localfile}","wb") { |dst|
|
24
|
+
dst.write(src.read)
|
25
|
+
}
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Compute hash code
|
30
|
+
def hashsum(filename)
|
31
|
+
checksum=Digest::MD5.new
|
32
|
+
buflen=1024
|
33
|
+
open(filename, "r") do |io|
|
34
|
+
counter = 0
|
35
|
+
while (!io.eof)
|
36
|
+
readBuf = io.readpartial(buflen)
|
37
|
+
env.ui.info('.',{:new_line => false}) if ((counter+=1) % 20000 == 0)
|
38
|
+
checksum.update(readBuf)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
return checksum.hexdigest
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
def verify_iso(definition,options)
|
46
|
+
filename=definition.iso_file
|
47
|
+
full_path=File.join(env.config.veewee.iso_dir,filename)
|
48
|
+
|
49
|
+
if File.exists?(full_path)
|
50
|
+
env.ui.info ""
|
51
|
+
env.ui.info "The isofile #{filename} already exists."
|
52
|
+
else
|
53
|
+
|
54
|
+
path1=Pathname.new(full_path)
|
55
|
+
path2=Pathname.new(Dir.pwd)
|
56
|
+
rel_path=path1.relative_path_from(path2).to_s
|
57
|
+
|
58
|
+
env.ui.info ""
|
59
|
+
env.ui.info "We did not find an isofile in <currentdir>/iso. \n\nThe definition provided the following download information:"
|
60
|
+
unless "#{definition.iso_src}"==""
|
61
|
+
env.ui.info "- Download url: #{definition.iso_src}"
|
62
|
+
end
|
63
|
+
env.ui.info "- Md5 Checksum: #{definition.iso_md5}"
|
64
|
+
env.ui.info "#{definition.iso_download_instructions}"
|
65
|
+
env.ui.info ""
|
66
|
+
|
67
|
+
if definition.iso_src == ""
|
68
|
+
env.ui.info "Please follow the instructions above:"
|
69
|
+
env.ui.info "- to get the ISO"
|
70
|
+
env.ui.info" - put it in <currentdir>/iso"
|
71
|
+
env.ui.info "- then re-run the command"
|
72
|
+
env.ui.info ""
|
73
|
+
exit -1
|
74
|
+
else
|
75
|
+
answer=nil
|
76
|
+
answer="yes" if options["auto"]==true
|
77
|
+
env.logger.info "Auto download enabled?#{answer} #{!options['auto'].nil?}"
|
78
|
+
if answer.nil?
|
79
|
+
answer=env.ui.ask("Download? (Yes/No)") {|q| q.default="No"}
|
80
|
+
end
|
81
|
+
|
82
|
+
if answer.downcase == "yes"
|
83
|
+
if !File.exists?(env.config.veewee.iso_dir)
|
84
|
+
env.ui.info "Creating an iso directory"
|
85
|
+
FileUtils.mkdir(env.config.veewee.iso_dir)
|
86
|
+
end
|
87
|
+
begin
|
88
|
+
download_progress(definition.iso_src,full_path)
|
89
|
+
rescue OpenURI::HTTPError => ex
|
90
|
+
env.ui.error "There was an error downloading #{definition.iso_src}:"
|
91
|
+
env.ui.error "#{ex}"
|
92
|
+
exit -1
|
93
|
+
end
|
94
|
+
else
|
95
|
+
env.ui.info "You have selected manual download: "
|
96
|
+
env.ui.info "curl -C - -L '#{definition.iso_src}' -o '#{rel_path}'"
|
97
|
+
env.ui.info "md5 '#{rel_path}' "
|
98
|
+
env.ui.info ""
|
99
|
+
exit
|
100
|
+
end
|
101
|
+
|
102
|
+
env.ui.info "Verifying md5 checksum : #{definition.iso_md5}"
|
103
|
+
file_md5=hashsum(full_path)
|
104
|
+
|
105
|
+
unless file_md5==definition.iso_md5
|
106
|
+
env.ui.error "The MD5 checksums for file #{filename } do not match: "
|
107
|
+
env.ui.error "- #{file_md5} (current) vs #{definition.iso_md5} (specified)"
|
108
|
+
exit -1
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
end #Module
|
117
|
+
|
118
|
+
end #Module
|
119
|
+
end #Module
|
120
|
+
end #Module
|