veewee 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. data/README.md +1 -1
  2. data/Rakefile +23 -23
  3. data/bin/veewee +1 -1
  4. data/doc/kvm.md +58 -9
  5. data/doc/providers.md +2 -2
  6. data/doc/vagrant.md +1 -1
  7. data/lib/vagrant_init.rb +0 -1
  8. data/lib/veewee/cli.rb +1 -1
  9. data/lib/veewee/command.rb +2 -2
  10. data/lib/veewee/command/fusion.rb +2 -2
  11. data/lib/veewee/command/kvm.rb +1 -1
  12. data/lib/veewee/command/parallels.rb +2 -2
  13. data/lib/veewee/command/vagrant/define.rb +1 -1
  14. data/lib/veewee/command/vagrant/undefine.rb +1 -1
  15. data/lib/veewee/command/vbox.rb +2 -2
  16. data/lib/veewee/config.rb +8 -10
  17. data/lib/veewee/definition.rb +41 -41
  18. data/lib/veewee/definitions.rb +27 -30
  19. data/lib/veewee/environment.rb +16 -16
  20. data/lib/veewee/error.rb +18 -15
  21. data/lib/veewee/provider/core/box/build.rb +1 -1
  22. data/lib/veewee/provider/kvm/box.rb +1 -6
  23. data/lib/veewee/provider/kvm/box/validate_kvm.rb +1 -1
  24. data/lib/veewee/provider/kvm/provider.rb +19 -32
  25. data/lib/veewee/provider/virtualbox/box/helper/create.rb +5 -1
  26. data/lib/veewee/providers.rb +22 -21
  27. data/lib/veewee/template.rb +9 -9
  28. data/lib/veewee/templates.rb +14 -15
  29. data/lib/veewee/ui.rb +7 -7
  30. data/lib/veewee/version.rb +1 -1
  31. data/templates/CentOS-6.3-i386-minimal/base.sh +1 -1
  32. data/templates/CentOS-6.3-i386-minimal/definition.rb +13 -4
  33. data/templates/CentOS-6.3-i386-minimal/ks.cfg +50 -14
  34. data/templates/CentOS-6.3-i386-minimal/virtualbox.sh +3 -3
  35. data/templates/CentOS-6.3-x86_64-minimal/base.sh +1 -1
  36. data/templates/CentOS-6.3-x86_64-netboot/base.sh +14 -0
  37. data/templates/CentOS-6.3-x86_64-netboot/chef.sh +3 -0
  38. data/templates/CentOS-6.3-x86_64-netboot/cleanup.sh +5 -0
  39. data/templates/CentOS-6.3-x86_64-netboot/definition.rb +40 -0
  40. data/templates/CentOS-6.3-x86_64-netboot/ks.cfg +41 -0
  41. data/templates/CentOS-6.3-x86_64-netboot/puppet.sh +12 -0
  42. data/templates/CentOS-6.3-x86_64-netboot/ruby.sh +3 -0
  43. data/templates/CentOS-6.3-x86_64-netboot/vagrant.sh +18 -0
  44. data/templates/CentOS-6.3-x86_64-netboot/virtualbox.sh +8 -0
  45. data/templates/{Debian-7.0-b2-i386-netboot → CentOS-6.3-x86_64-netboot}/zerodisk.sh +0 -0
  46. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-amd64-netboot}/base.sh +2 -3
  47. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-amd64-netboot}/chef.sh +0 -0
  48. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-amd64-netboot}/cleanup-virtualbox.sh +0 -0
  49. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-amd64-netboot}/cleanup.sh +0 -0
  50. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-amd64-netboot}/definition.rb +3 -3
  51. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-amd64-netboot}/preseed.cfg +0 -0
  52. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-amd64-netboot}/puppet.sh +0 -0
  53. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-amd64-netboot}/ruby.sh +0 -0
  54. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-amd64-netboot}/vagrant.sh +0 -0
  55. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-amd64-netboot}/virtualbox.sh +0 -0
  56. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-amd64-netboot}/zerodisk.sh +0 -0
  57. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-i386-netboot}/base.sh +2 -3
  58. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-i386-netboot}/chef.sh +0 -0
  59. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-i386-netboot}/cleanup-virtualbox.sh +0 -0
  60. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-i386-netboot}/cleanup.sh +0 -0
  61. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-i386-netboot}/definition.rb +3 -3
  62. data/templates/{Debian-7.0-b2-i386-netboot → Debian-7.0-b4-i386-netboot}/preseed.cfg +0 -0
  63. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-i386-netboot}/puppet.sh +0 -0
  64. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-i386-netboot}/ruby.sh +0 -0
  65. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-i386-netboot}/vagrant.sh +0 -0
  66. data/templates/{Debian-7.0-b3-amd64-netboot → Debian-7.0-b4-i386-netboot}/virtualbox.sh +0 -0
  67. data/templates/Debian-7.0-b4-i386-netboot/zerodisk.sh +3 -0
  68. data/templates/Fedora-18-i386/definition.rb +6 -6
  69. data/templates/Fedora-18-i386/postinstall.sh +3 -1
  70. data/templates/Fedora-18-x86_64/definition.rb +5 -5
  71. data/templates/Fedora-18-x86_64/postinstall.sh +6 -1
  72. data/templates/ubuntu-12.04.1-server-amd64-packages/postinstall.sh +4 -5
  73. data/templates/ubuntu-12.04.1-server-amd64/postinstall.sh +4 -5
  74. data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +6 -6
  75. data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +6 -6
  76. data/templates/windows-8-amd64/Autounattend.xml +140 -0
  77. data/templates/windows-8-amd64/README.md +134 -0
  78. data/templates/windows-8-amd64/cygwin-setup.exe +0 -0
  79. data/templates/windows-8-amd64/definition.rb +101 -0
  80. data/templates/windows-8-amd64/install-cygwin-sshd.bat +38 -0
  81. data/templates/windows-8-amd64/install-winrm.bat +11 -0
  82. data/templates/windows-8-amd64/oracle-cert.cer +0 -0
  83. data/templates/windows-8-amd64/postinstall.sh +122 -0
  84. data/templates/windows-8-amd64/winrm.rb +8 -0
  85. data/templates/windows-8-i386/Autounattend.xml +140 -0
  86. data/templates/windows-8-i386/README.md +134 -0
  87. data/templates/windows-8-i386/cygwin-setup.exe +0 -0
  88. data/templates/windows-8-i386/definition.rb +101 -0
  89. data/templates/windows-8-i386/install-cygwin-sshd.bat +38 -0
  90. data/templates/windows-8-i386/install-winrm.bat +11 -0
  91. data/templates/windows-8-i386/oracle-cert.cer +0 -0
  92. data/templates/windows-8-i386/postinstall.sh +122 -0
  93. data/templates/windows-8-i386/winrm.rb +8 -0
  94. data/test/build_realtest.rb +4 -4
  95. data/veewee.gemspec +8 -9
  96. metadata +55 -27
@@ -0,0 +1,134 @@
1
+ You can download a free trial of Windows Server 2008 Enterprise: (60 day eval, expandable to 240 days)
2
+
3
+ From http://www.microsoft.com/download/en/details.aspx?id=8371
4
+
5
+ 64bit
6
+ url: http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
7
+ filename: 6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.iso
8
+ md5sum: 0477c88678efb8ebc5cd7a9e9efd8b82
9
+
10
+
11
+ 32bit
12
+ url: http://download.microsoft.com/download/B/4/D/B4DC75A1-D7D2-4F31-87F9-E02C950E8D31/6001.18000.080118-1840_x86fre_Server_en-us-KRMSFRE_EN_DVD.iso
13
+
14
+
15
+ - place it in a directory called iso
16
+
17
+ The installation uses the Standard way for Windows Unattended installation. The XML file was created using the Windows AIK kit, but the file can also be edited by hand.
18
+
19
+ You can download Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008:
20
+ from http://www.microsoft.com/download/en/details.aspx?id=9085
21
+ file: 6001.18000.080118-1840-kb3aikl_en.iso
22
+ md5sum: b83fad8fd28e637b82cb4a6bef7d6920
23
+
24
+ - Building the machine creates a floppy that contains:
25
+ - AutoUnattend.xml (that will configure the windows)
26
+ - winrm-install.bat (activates the http and https listener + punches the firewall hole)
27
+
28
+ AIK also includes dism, which will allow you to choose a specific version:
29
+
30
+ If you want to install a different version, edit Autoattended.xml and replace the /IMAGE/NAME value with
31
+ one of the names listed in the Longhorn install.wim on the install .iso
32
+
33
+ <InstallFrom>
34
+ <MetaData wcm:action="add">
35
+ <Key>/IMAGE/NAME</Key>
36
+ <Value>Windows Longhorn SERVERSTANDARD</Value> ### This comes from the Name: field below
37
+ </MetaData>
38
+ </InstallFrom>
39
+
40
+ PS C:\Users\Administrator> Dism /Get-WIMInfo /WimFile:d:\sources\install.wim
41
+
42
+ Deployment Image Servicing and Management tool
43
+ Version: 6.1.7600.16385
44
+
45
+ Details for image : d:\sources\install.wim
46
+
47
+ Index : 1
48
+ Name : Windows Longhorn SERVERSTANDARD
49
+ Description : Windows Longhorn SERVERSTANDARD
50
+ Size : 8,784,297,519 bytes
51
+
52
+ Index : 2
53
+ Name : Windows Longhorn SERVERENTERPRISE
54
+ Description : Windows Longhorn SERVERENTERPRISE
55
+ Size : 8,792,036,862 bytes
56
+
57
+ Index : 3
58
+ Name : Windows Longhorn SERVERDATACENTER
59
+ Description : Windows Longhorn SERVERDATACENTER
60
+ Size : 8,792,568,645 bytes
61
+
62
+ Index : 4
63
+ Name : Windows Longhorn SERVERSTANDARDCORE
64
+ Description : Windows Longhorn SERVERSTANDARDCORE
65
+ Size : 2,512,939,954 bytes
66
+
67
+ Index : 5
68
+ Name : Windows Longhorn SERVERENTERPRISECORE
69
+ Description : Windows Longhorn SERVERENTERPRISECORE
70
+ Size : 2,522,686,340 bytes
71
+
72
+ Index : 6
73
+ Name : Windows Longhorn SERVERDATACENTERCORE
74
+ Description : Windows Longhorn SERVERDATACENTERCORE
75
+ Size : 2,522,615,418 bytes
76
+
77
+
78
+ This gets us nearly there, but we still need a winrm provisioner, as I don't like having to install cygwin.
79
+
80
+ Expose the winrm port:
81
+
82
+ <pre>
83
+ $ gem install chef
84
+ $ gem install knife-windows
85
+ #Create a tunnel
86
+ $ ssh -p 7222 -L5985:localhost:5985 vagrant@localhost
87
+ $ knife bootstrap windows winrm localhost -x Administrator -P 'vagrant'
88
+ </pre>
89
+
90
+
91
+ - http://wiki.opscode.com/display/chef/Knife+Windows+Bootstrap
92
+ - https://github.com/opscode/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-shell.erb
93
+
94
+ - https://github.com/zenchild/WinRM
95
+
96
+ - http://devopscloud.net/2011/04/17/managing-chef-from-windows-7/
97
+ - http://devopscloud.net/2011/04/28/powershell-userdata-to-start-a-chef-run/
98
+ - http://devopscloud.net/2011/03/23/dissection-of-a-chef-recipe-or-two-for-windows/
99
+ - https://github.com/pmorton/chef-windows-installer
100
+
101
+ ==
102
+ https://github.com/zenchild/WinRM/issues/unreads#issue/1
103
+ http -> requires unencryptedwinrm quickconfig (said yes to enable firewall)
104
+ winrm p winrm/config/service @{AllowUnencrypted="true"}
105
+ winrm set winrm/config/service/auth @{Basic="true"}netsh advfirewall firewall set rule group="remote administration" new enable=yes
106
+
107
+ - http://forums.citrix.com/thread.jspa?messageID=1535826
108
+ - http://support.microsoft.com/kb/2019527
109
+
110
+ winrm get winrm/config
111
+
112
+ The purpose of configuring WinRM for HTTPS is to encrypt the data being sent across the wire.
113
+
114
+ WinRM HTTPS requires a local computer "Server Authentication" certificate with a CN matching the hostname, that is not expired, revoked, or self-signed to be installed.
115
+
116
+ To install or view certificates for the local computer:
117
+
118
+ - click Start, run, MMC, "File" menu, "Add or Remove Snap-ins" select "Certificates" and click "Add". Go through the wizard selecting "Computer account".
119
+
120
+ - Install or view the certificates under:
121
+ Certificates (Local computer)
122
+ Personal
123
+ Certificates
124
+
125
+ If you do not have a Sever Authenticating certificate consult your certicate administrator. If you have a microsoft Certificate server you may be abel to request a certificate using the web certificate template from HTTPS://<MyDomainCertificateServer>/certsrv
126
+
127
+ Once the certificate is installed type the following to configure WINRM to listen on HTTPS:
128
+
129
+ winrm quickconfig -transport:https
130
+
131
+ If you do not have an appropriate certificate you can run the following with the authentication methods configured for WinRM however the data will not be encrypted.
132
+
133
+ winrm quickconfig
134
+
@@ -0,0 +1,101 @@
1
+ # Download Windows 8 English, 32-bit (x86)
2
+ # http://msdn.microsoft.com/de-de/evalcenter/jj554510.aspx?wt.mc_id=MEC_132_1_4
3
+ # 32bit
4
+ # http://care.dlservice.microsoft.com/dl/download/5/3/C/53C31ED0-886C-4F81-9A38-F58CE4CE71E8/9200.16384.WIN8_RTM.120725-1247_X86FRE_ENTERPRISE_EVAL_EN-US-HRM_CENA_X86FREE_EN-US_DV5.ISO
5
+
6
+
7
+ # Win2008 requires at least 10gig hard drive to install...
8
+
9
+ Veewee::Session.declare({
10
+ :os_type_id => 'Windows8',
11
+ :iso_file => "9200.16384.WIN8_RTM.120725-1247_X86FRE_ENTERPRISE_EVAL_EN-US-HRM_CENA_X86FREE_EN-US_DV5.ISO",
12
+ :iso_md5 => "e0ba8ad5c893dd3f5b83ea77fa4946e7",
13
+ :iso_src => "http://iso.esd.microsoft.com/WRPDL/D29D6C5B1D8AF956B5DA9DF738CFD92DFD4F6C8FB/Windows8-ReleasePreview-64bit-English.iso",
14
+ :iso_download_timeout => "1000",
15
+ :cpu_count => '1',
16
+ :memory_size=> '1024',
17
+ :disk_size => '20280', :disk_format => 'VDI', :hostiocache => 'off',
18
+
19
+ :floppy_files => [
20
+ "Autounattend.xml", # automate install and setup winrm
21
+ "install-winrm.bat",
22
+ "install-cygwin-sshd.bat",
23
+ "cygwin-setup.exe",
24
+ "oracle-cert.cer"
25
+ ],
26
+
27
+ :boot_wait => "120",
28
+ # after 40 seconds, hit these keys to not enter a product key and fully automate the install
29
+ # if your machine is slower it may take more time
30
+ :boot_cmd_sequence => [
31
+ '<Tab><Spacebar>'
32
+ ],
33
+
34
+ :ssh_login_timeout => "10000",
35
+ # Actively attempt to ssh in for 10000 seconds
36
+ :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
37
+ :ssh_host_port => "7233", :ssh_guest_port => "22",
38
+ # And run postinstall.sh for up to 10000 seconds
39
+ :postinstall_timeout => "10000",
40
+ :postinstall_files => ["postinstall.sh"],
41
+ # No sudo on windows
42
+ :sudo_cmd => "sh '%f'",
43
+ # Shutdown is different as well
44
+ :shutdown_cmd => "shutdown -P now",
45
+ })
46
+
47
+
48
+ # To edit the Autounattend.xml and validate it:
49
+ # Download Automated Installation Kit (AIK) for Windows Vista SP1 and Windows Server 2008:
50
+ # http://www.microsoft.com/download/en/details.aspx?id=9085
51
+ # Resulting in 6001.18000.080118-1840-kb3aikl_en.iso
52
+ # md5sum b83fad8fd28e637b82cb4a6bef7d6920 6001.18000.080118-1840-kb3aikl_en.iso
53
+
54
+ # AIK also includes dism, which will allow you to choose a specific version:
55
+
56
+ # If you want to install a different version, edit Autoattended.xml and replace the /IMAGE/NAME value with
57
+ # one of the names listed in the Longhorn install.wim on the install .iso
58
+
59
+ # <InstallFrom>
60
+ # <MetaData wcm:action="add">
61
+ # <Key>/IMAGE/NAME</Key>
62
+ # <Value>Windows Longhorn SERVERSTANDARD</Value> ### This comes from the Name: field below
63
+ # </MetaData>
64
+ # </InstallFrom>
65
+
66
+ # PS C:\Users\Administrator> Dism /Get-WIMInfo /WimFile:d:\sources\install.wim
67
+
68
+ # Deployment Image Servicing and Management tool
69
+ # Version: 6.1.7600.16385
70
+
71
+ # Details for image : d:\sources\install.wim
72
+
73
+ # Index : 1
74
+ # Name : Windows Longhorn SERVERSTANDARD
75
+ # Description : Windows Longhorn SERVERSTANDARD
76
+ # Size : 8,784,297,519 bytes
77
+
78
+ # Index : 2
79
+ # Name : Windows Longhorn SERVERENTERPRISE
80
+ # Description : Windows Longhorn SERVERENTERPRISE
81
+ # Size : 8,792,036,862 bytes
82
+
83
+ # Index : 3
84
+ # Name : Windows Longhorn SERVERDATACENTER
85
+ # Description : Windows Longhorn SERVERDATACENTER
86
+ # Size : 8,792,568,645 bytes
87
+
88
+ # Index : 4
89
+ # Name : Windows Longhorn SERVERSTANDARDCORE
90
+ # Description : Windows Longhorn SERVERSTANDARDCORE
91
+ # Size : 2,512,939,954 bytes
92
+
93
+ # Index : 5
94
+ # Name : Windows Longhorn SERVERENTERPRISECORE
95
+ # Description : Windows Longhorn SERVERENTERPRISECORE
96
+ # Size : 2,522,686,340 bytes
97
+
98
+ # Index : 6
99
+ # Name : Windows Longhorn SERVERDATACENTERCORE
100
+ # Description : Windows Longhorn SERVERDATACENTERCORE
101
+ # Size : 2,522,615,418 bytes
@@ -0,0 +1,38 @@
1
+ REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be
2
+
3
+ REM create the cygwin directory
4
+ cmd /c mkdir %SystemDrive%\cygwin
5
+ copy a:cygwin-setup.exe %SystemDrive%\cygwin
6
+
7
+ REM goto a temp directory
8
+ cd %SystemDrive%\windows\temp
9
+
10
+ REM run the installation
11
+ cmd /c a:/cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
12
+
13
+ %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
14
+
15
+ REM /bin/ash is the right shell for this command
16
+ cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall
17
+
18
+ cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group
19
+
20
+ cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd
21
+
22
+ %SystemDrive%\cygwin\usr\bin\sleep 1
23
+
24
+ %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /usr/bin/ssh-host-config -y -c "ntsecbinmode tty" -w "abc&&123!!" '
25
+
26
+ %SystemDrive%\cygwin\usr\bin\sleep 2
27
+
28
+ cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes
29
+
30
+ cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
31
+
32
+ %SystemDrive%\cygwin\usr\bin\sleep 2
33
+
34
+ net start sshd
35
+
36
+ # Fix corrupt recycle bin
37
+ # http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
38
+ cmd /c rd /s /q c:\$Recycle.bin
@@ -0,0 +1,11 @@
1
+ cmd /c winrm quickconfig -q
2
+ cmd /c winrm quickconfig -transport:http
3
+ cmd /c winrm set winrm/config @{MaxTimeoutms="1800000"}
4
+ cmd /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
5
+ cmd /c winrm set winrm/config/service @{AllowUnencrypted="true"}
6
+ cmd /c winrm set winrm/config/service/auth @{Basic="true"}
7
+ cmd /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
8
+ cmd /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
9
+ cmd /c netsh firewall add portopening TCP 5985 "Port 5985"
10
+ cmd /c net stop winrm
11
+ cmd /c net start winrm
@@ -0,0 +1,122 @@
1
+ # Create the home directory
2
+ mkdir /home/vagrant
3
+ chown vagrant /home/vagrant
4
+ cd /home/vagrant
5
+
6
+ # Install ssh certificates
7
+ mkdir /home/vagrant/.ssh
8
+ chmod 700 /home/vagrant/.ssh
9
+ cd /home/vagrant/.ssh
10
+ wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
11
+ chown -R vagrant /home/vagrant/.ssh
12
+ cd ..
13
+
14
+ # Install rpm,apt-get like code for cygwin
15
+ # http://superuser.com/questions/40545/upgrading-and-installing-packages-through-the-cygwin-command-line
16
+ wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
17
+ chmod +x apt-cyg
18
+ mv apt-cyg /usr/local/bin/
19
+
20
+ # Download Daemontools Lite
21
+ # This needs some fixing as the url seems to change every X time ...
22
+ #wget http://www.daemon-tools.cc/eng/downloads/dtproAdv
23
+ #cat http://www.daemon-tools.cc/eng/downloads/dtLite|grep <div download ...>
24
+ URL=$(curl -L http://www.daemon-tools.cc/eng/downloads/dtLite|grep http|grep exe|cut -d '"' -f 4)
25
+ curl -L $URL -o daemontools.exe
26
+
27
+ #curl -L http://disc-tools.com/request?p=70e5b112a42060a5439c5edec8e4f8c3/DTLite4402-0131.exe -o daemontools.exe
28
+ chmod +x daemontools.exe
29
+
30
+ # Silent install Daemontools
31
+ # http://www.daemon-help.com/en/installation_notes_lite/installation_lite.html
32
+ # Silent install - http://forum.daemon-tools.cc/f24/dt-4-08-a-15030/
33
+ ./daemontools.exe /S
34
+
35
+ # Download Virtualbox Additions
36
+ VBOX_VERSION="4.0.8"
37
+ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
38
+
39
+ # Mount iso file
40
+ # http://www.daemon-help.com/en/windows_integration_lite/command_line_parameters.html
41
+ # /cygdrive/c/Program Files (x86)/DAEMON Tools Pro
42
+ cd "/cygdrive/c/Program Files (x86)/DAEMON Tools Lite"
43
+ ./DTLite.exe -mount 0,"c:\cygwin\home\vagrant\VBoxGuestAdditions_4.0.8.iso"
44
+
45
+ # Mark Oracle as a trusted installer
46
+ #http://blogs.msdn.com/b/steverac/archive/2009/07/09/adding-certificates-to-the-local-certificates-store-and-setting-local-policy-using-a-command-line-system-center-updates-publisher-example.aspx
47
+
48
+ certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
49
+
50
+ # Install the Virtualbox Additions
51
+ cd /cygdrive/e
52
+ ./VBoxWindowsAdditions.exe /S
53
+
54
+ #http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/
55
+
56
+ # Unmount ISO file
57
+ cd "/cygdrive/c/Program Files (x86)/DAEMON Tools Lite"
58
+ ./DTLite.exe -unmount 0
59
+
60
+ # Next step is get ruby working
61
+ # But thanks to opscode's work , that should not be an issue
62
+ # https://github.com/opscode/knife-windows/blob/master/lib/chef/knife/bootstrap/windows-shell.erb
63
+
64
+ #Installing ruby
65
+ cd /home/vagrant
66
+
67
+ # Ruby 1.9
68
+ #wget http://rubyforge.org/frs/download.php/74298/rubyinstaller-1.9.2-p180.exe -O rubyinstaller.exe
69
+ # Ruby 1.8
70
+ wget http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/rubyinstaller-1.8.7-p334.exe -O rubyinstaller.exe
71
+
72
+ chmod +x rubyinstaller.exe
73
+ ./rubyinstaller.exe /verysilent /dir="C:\ruby" /tasks="assocfiles,modpath" /SUPPRESSMSGBOXES
74
+
75
+ # Now add it to the path cmd, and cygwin path
76
+ # http://serverfault.com/questions/63017/how-do-i-modify-the-system-path-in-windows-2003-windows-2008-using-a-script
77
+ /cygdrive/c/Windows/System32/setx.exe PATH "c:\windows\system32;c:\ruby\bin" /M
78
+ export PATH=$PATH:/cygdrive/c/ruby/bin
79
+
80
+ # Install Ruby dev kit (native extensions)
81
+ mkdir /cygdrive/c/devkit
82
+ cd /cygdrive/c/devkit
83
+ wget --no-check-certificate http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe -O rubydevkit.exe
84
+ chmod +x rubydevkit.exe
85
+ ./rubydevkit -y
86
+ ruby dk.rb init
87
+ ruby dk.rb install
88
+
89
+ # Installing puppet
90
+ gem.bat install puppet --no-rdoc --no-ri --verbose
91
+
92
+ # Installing chef required gems on windows
93
+ # For ruby 1.8
94
+ gem.bat install win32-open3 ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
95
+ # For ruby 1.9
96
+ #gem.bat install win32-open3 rdp-ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
97
+
98
+ # Install chef
99
+ gem.bat install ohai --no-rdoc --no-ri --verbose
100
+ gem.bat install chef --no-rdoc --no-ri --verbose
101
+
102
+ # Currently 1.9 ruby + chef 10 doesn't seem to be able to
103
+ #http://stackoverflow.com/questions/4819807/ohai-fails-to-determine-os-version-in-cygwin
104
+
105
+ #Making aliases
106
+ cat <<EOF > /home/vagrant/.bash_profile
107
+ alias chef-client="chef-client.bat"
108
+ alias gem="gem.bat"
109
+ alias ruby="ruby.exe"
110
+ alias puppet="puppet.bat"
111
+ alias ohai="ohai.bat"
112
+ alias irb="irb.bat"
113
+ alias facter="facter.bat"
114
+ EOF
115
+
116
+ # Reboot
117
+ # http://www.techrepublic.com/blog/datacenter/restart-windows-server-2003-from-the-command-line/245
118
+ shutdown.exe /r /t 0 /c "Vagrant initial reboot"
119
+
120
+ # Mounting a directory
121
+ #./net.exe use x: \\vboxsvr\veewee-validation
122
+
@@ -0,0 +1,8 @@
1
+ require 'winrm'
2
+ endpoint = 'http://localhost:5985/wsman'
3
+ winrm=WinRM::WinRMWebService.new(endpoint, :plaintext, :user => 'Administrator', :pass => 'vagrant', :basic_auth_only => true)
4
+ winrm.cmd('ifconfig /all') do |stdout, stderr|
5
+ STDOUT.print stdout
6
+ STDERR.print stderr
7
+ end
8
+ #winrm.open_shell
@@ -19,8 +19,8 @@ class TestVeeweeBuild < Test::Unit::TestCase
19
19
  # - postinstall execution
20
20
  def test_box_1_build
21
21
  assert_nothing_raised {
22
- #@box.build({"auto" => true,:force => true, #:nogui => true })
23
- @box.build({"auto" => true,"force" => true })
22
+ @box.build({'auto' => true,'force' => true, 'nogui' => true })
23
+ #@box.build({"auto" => true,"force" => true })
24
24
  }
25
25
  end
26
26
 
@@ -51,8 +51,8 @@ class TestVeeweeBuild < Test::Unit::TestCase
51
51
  # Now try build again (with no force flag)
52
52
  def test_box_5_build
53
53
  assert_raise(Veewee::Error) {
54
- @box.build({"auto" => true})
55
- #@box.build({"auto" => true,:force => true, :nogui => true })
54
+ #@box.build({"auto" => true})
55
+ @box.build({"auto" => true,'force' => true, 'nogui' => true })
56
56
  }
57
57
  end
58
58