veewee 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/Gemfile +4 -0
  2. data/README.md +1 -1
  3. data/doc/definition.md +18 -0
  4. data/doc/kvm.md +28 -1
  5. data/doc/template.md +53 -2
  6. data/lib/veewee/command/fusion.rb +37 -3
  7. data/lib/veewee/command/vagrant/basebox.rb +2 -0
  8. data/lib/veewee/command/vagrant/winrm.rb +39 -0
  9. data/lib/veewee/command/vbox.rb +18 -0
  10. data/lib/veewee/definition.rb +13 -3
  11. data/lib/veewee/error.rb +3 -0
  12. data/lib/veewee/provider/core/box.rb +7 -0
  13. data/lib/veewee/provider/core/box/build.rb +34 -14
  14. data/lib/veewee/provider/core/box/copy.rb +17 -0
  15. data/lib/veewee/provider/core/box/exec.rb +31 -12
  16. data/lib/veewee/provider/core/box/floppy.rb +1 -0
  17. data/lib/veewee/provider/core/box/halt.rb +7 -3
  18. data/lib/veewee/provider/core/box/validate_tags.rb +8 -2
  19. data/lib/veewee/provider/core/box/wincp.rb +120 -0
  20. data/lib/veewee/provider/core/box/winrm.rb +59 -0
  21. data/lib/veewee/provider/core/helper/comm.rb +47 -0
  22. data/lib/veewee/provider/core/helper/web.rb +20 -9
  23. data/lib/veewee/provider/core/helper/winrm.rb +167 -0
  24. data/lib/veewee/provider/kvm/box/create.rb +59 -3
  25. data/lib/veewee/provider/kvm/provider.rb +6 -6
  26. data/lib/veewee/provider/parallels/box/helper/buildinfo.rb +1 -1
  27. data/lib/veewee/provider/virtualbox/box.rb +1 -0
  28. data/lib/veewee/provider/virtualbox/box/build.rb +4 -2
  29. data/lib/veewee/provider/virtualbox/box/create.rb +32 -12
  30. data/lib/veewee/provider/virtualbox/box/helper/buildinfo.rb +6 -3
  31. data/lib/veewee/provider/virtualbox/box/helper/create.rb +20 -5
  32. data/lib/veewee/provider/virtualbox/box/helper/winrm_options.rb +31 -0
  33. data/lib/veewee/provider/virtualbox/box/up.rb +33 -12
  34. data/lib/veewee/provider/virtualbox/box/winrm.rb +13 -0
  35. data/lib/veewee/provider/vmfusion/box.rb +2 -0
  36. data/lib/veewee/provider/vmfusion/box/add_share.rb +18 -0
  37. data/lib/veewee/provider/vmfusion/box/build.rb +3 -1
  38. data/lib/veewee/provider/vmfusion/box/create.rb +7 -2
  39. data/lib/veewee/provider/vmfusion/box/helper/buildinfo.rb +9 -6
  40. data/lib/veewee/provider/vmfusion/box/helper/ip.rb +1 -1
  41. data/lib/veewee/provider/vmfusion/box/helper/winrm_options.rb +21 -0
  42. data/lib/veewee/provider/vmfusion/box/template.rb +7 -3
  43. data/lib/veewee/provider/vmfusion/box/template.vmx.erb +6 -0
  44. data/lib/veewee/provider/vmfusion/box/winrm.rb +12 -0
  45. data/lib/veewee/provider/vmfusion/provider.rb +7 -1
  46. data/lib/veewee/version.rb +1 -1
  47. data/templates/CentOS-5.6-x86_64-netboot-packages/definition.rb +16 -0
  48. data/templates/CentOS-5.6-x86_64-netboot-packages/ks.cfg +47 -0
  49. data/templates/CentOS-5.6-x86_64-netboot-packages/postinstall.sh +61 -0
  50. data/templates/Debian-7.0-b3-amd64-netboot/base.sh +27 -0
  51. data/templates/Debian-7.0-b3-amd64-netboot/chef.sh +2 -0
  52. data/templates/Debian-7.0-b3-amd64-netboot/cleanup-virtualbox.sh +4 -0
  53. data/templates/Debian-7.0-b3-amd64-netboot/cleanup.sh +17 -0
  54. data/templates/Debian-7.0-b3-amd64-netboot/definition.rb +51 -0
  55. data/templates/Debian-7.0-b3-amd64-netboot/preseed.cfg +313 -0
  56. data/templates/Debian-7.0-b3-amd64-netboot/puppet.sh +2 -0
  57. data/templates/Debian-7.0-b3-amd64-netboot/ruby.sh +10 -0
  58. data/templates/Debian-7.0-b3-amd64-netboot/vagrant.sh +25 -0
  59. data/templates/Debian-7.0-b3-amd64-netboot/virtualbox.sh +13 -0
  60. data/templates/Debian-7.0-b3-amd64-netboot/zerodisk.sh +3 -0
  61. data/templates/Fedora-18-i386/definition.rb +17 -0
  62. data/templates/Fedora-18-i386/ks.cfg +75 -0
  63. data/templates/Fedora-18-i386/postinstall.sh +38 -0
  64. data/templates/Fedora-18-x86_64/definition.rb +17 -0
  65. data/templates/Fedora-18-x86_64/ks.cfg +75 -0
  66. data/templates/Fedora-18-x86_64/postinstall.sh +38 -0
  67. data/templates/OracleLinux-6.3-x86_64-DVD/base.sh +30 -0
  68. data/templates/OracleLinux-6.3-x86_64-DVD/chef.sh +3 -0
  69. data/templates/OracleLinux-6.3-x86_64-DVD/cleanup.sh +5 -0
  70. data/templates/OracleLinux-6.3-x86_64-DVD/definition.rb +40 -0
  71. data/templates/OracleLinux-6.3-x86_64-DVD/ks.cfg +42 -0
  72. data/templates/OracleLinux-6.3-x86_64-DVD/puppet.sh +12 -0
  73. data/templates/OracleLinux-6.3-x86_64-DVD/ruby.sh +3 -0
  74. data/templates/OracleLinux-6.3-x86_64-DVD/vagrant.sh +18 -0
  75. data/templates/OracleLinux-6.3-x86_64-DVD/virtualbox.sh +8 -0
  76. data/templates/OracleLinux-6.3-x86_64-DVD/zerodisk.sh +3 -0
  77. data/templates/funtoo-latest-x86_64/definition.rb +37 -0
  78. data/templates/funtoo-latest-x86_64/postinstall.sh +401 -0
  79. data/templates/openbsd50_amd64/definition.rb +3 -2
  80. data/templates/openbsd50_amd64/postinstall.sh +4 -4
  81. data/templates/openbsd50_i386/definition.rb +4 -4
  82. data/templates/openbsd52_amd64/README +28 -0
  83. data/templates/openbsd52_amd64/definition.rb +85 -0
  84. data/templates/openbsd52_amd64/postinstall.sh +81 -0
  85. data/templates/openbsd52_i386/README +28 -0
  86. data/templates/openbsd52_i386/definition.rb +85 -0
  87. data/templates/openbsd52_i386/postinstall.sh +81 -0
  88. data/templates/windows-2008R1-serverstandard-amd64/Autounattend.xml +6 -6
  89. data/templates/windows-2008R1-serverweb-amd64/install-winrm.bat +1 -1
  90. data/templates/windows-2008R2-serverstandard-amd64-winrm/Autounattend.xml +224 -0
  91. data/templates/windows-2008R2-serverstandard-amd64-winrm/README.md +87 -0
  92. data/templates/windows-2008R2-serverstandard-amd64-winrm/definition.rb +33 -0
  93. data/templates/windows-2008R2-serverstandard-amd64-winrm/install-chef.bat +2 -0
  94. data/templates/windows-2008R2-serverstandard-amd64-winrm/install-vbox.bat +4 -0
  95. data/templates/windows-2008R2-serverstandard-amd64-winrm/oracle-cert.cer +0 -0
  96. data/templates/windows-2008R2-serverstandard-amd64-winrm/postinstall.sh +74 -0
  97. data/templates/windows-7-enterprise-amd64-winrm/Autounattend.xml +227 -0
  98. data/templates/windows-7-enterprise-amd64-winrm/README.md +52 -0
  99. data/templates/windows-7-enterprise-amd64-winrm/definition.rb +27 -0
  100. data/templates/windows-7-enterprise-amd64-winrm/install-chef.bat +2 -0
  101. data/templates/windows-7-enterprise-amd64-winrm/install-fusion.bat +18 -0
  102. data/templates/windows-7-enterprise-amd64-winrm/install-puppet.bat +4 -0
  103. data/templates/windows-7-enterprise-amd64-winrm/install-vbox.bat +4 -0
  104. data/templates/windows-7-enterprise-amd64-winrm/oracle-cert.cer +0 -0
  105. data/templates/windows-7-enterprise-amd64-winrm/postinstall.bat +74 -0
  106. data/validation/veewee-windows.feature +34 -0
  107. data/veewee.gemspec +1 -1
  108. metadata +73 -7
data/Gemfile CHANGED
@@ -10,5 +10,9 @@ source "http://rubygems.org"
10
10
 
11
11
  group :test do
12
12
  gem "rake"
13
+ #gem "ruby-libvirt"
14
+ gem "em-winrm", :git => 'git://github.com/hh/em-winrm.git', :ref => '31745601d3'
15
+ #gem "chef"
16
+ #gem "knife-windows"
13
17
  end
14
18
  gemspec
data/README.md CHANGED
@@ -34,4 +34,4 @@ IDEAS:
34
34
 
35
35
  [whren - 2012/04/12]
36
36
 
37
- See [use of pre_postinstall_file in defition.rb](https://github.com/whren/veewee/wiki/Use-of-pre_postinstall_file-in-definition.rb)
37
+ See [use of pre_postinstall_file in definition.rb](https://github.com/whren/veewee/wiki/Use-of-pre_postinstall_file-in-definition.rb)
@@ -63,3 +63,21 @@ Add '.erb' to your files in a definition and they will get rendered (useful for
63
63
  ## Removing a definition
64
64
 
65
65
  veewee vbox undefine 'myubuntu'
66
+
67
+ ## Provider ``vm_options``
68
+
69
+ Each provider _can_ take options that are specific to them ; more detail will
70
+ be available in each provider documentation but let's have a quick overview.
71
+
72
+ Veewee::Definition.declare( {
73
+ :cpu_count => '1', :memory_size=> '256',
74
+ :disk_size => '10140', :disk_format => 'VDI', :disk_variant => 'Standard',
75
+ # […]
76
+ :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
77
+ :kvm => { :vm_options => ['network_type' => 'bridge', 'network_bridge_name' => 'brlxc0']}
78
+ :virtualbox => { :vm_options => [ 'pae' => 'on', 'ioapic' => 'one'] }
79
+ }
80
+ )
81
+
82
+ This box will have ``pae`` and ``ioapic`` enabled on virtualbox, and will use
83
+ the ``brlxc0`` bridge on with kvm (on libvirt).
data/doc/kvm.md CHANGED
@@ -1,8 +1,35 @@
1
1
  NOTE:Virtualbox doesn't like KVM to be enabled
2
2
 
3
- check with
3
+ ## Prerequires
4
4
 
5
+ To check if you're kernel can run kvm :
6
+
7
+ # kvm_ok or kvm-ok command (on Ubuntu at least)
5
8
  kvm_ok
9
+ # or look for vmx or svm in /proc/cpuinfo
10
+ egrep '^flags.*(vmx|svm)' /proc/cpuinfo
11
+
12
+ The modules needed are the following : kvm, kvm_intel or kvm-amd.
13
+
14
+ ## Define a new box
15
+
16
+ The workflow to create a box is almost the same as with the Virtualbox
17
+ provider (and others).
18
+
19
+ ## Options
20
+
21
+ There is currently few options supported :
22
+
23
+ 1. **network_type**: the type of network used by this box on libvirt. It could
24
+ be either _network_ (for using the default network) or _bridge_.
25
+ 2. **network_bridge_name**: the name of the bridge. It is used just in case
26
+ **network_type** is set to _bridge_.
27
+ 3. **pool_name**: the _storage_ pool name to be used when creating the box. If
28
+ not specified, the default one is used. _Note: it is currently not working
29
+ with the current fog version (1.7.0) but should be fixed as soon as the fog
30
+ gem is released_.
31
+
32
+ ## Notes
6
33
 
7
34
  Remove modules:
8
35
 
@@ -14,23 +14,44 @@ To see all the templates provided:
14
14
  veewee vbox define '<box_name>' 'archlinux-x86_64'
15
15
  veewee vbox define '<box_name>' 'archlinux-x86_64-netboot'
16
16
  veewee vbox define '<box_name>' 'CentOS-4.8-i386'
17
+ veewee vbox define '<box_name>' 'CentOS-5.5-i386-netboot'
17
18
  veewee vbox define '<box_name>' 'CentOS-5.5-x86_64-netboot'
18
19
  veewee vbox define '<box_name>' 'CentOS-5.6-i386'
19
20
  veewee vbox define '<box_name>' 'CentOS-5.6-i386-netboot'
20
21
  veewee vbox define '<box_name>' 'CentOS-5.6-x86_64-netboot'
22
+ veewee vbox define '<box_name>' 'CentOS-5.6-x86_64-netboot-packages'
21
23
  veewee vbox define '<box_name>' 'CentOS-5.7-i386-netboot'
22
24
  veewee vbox define '<box_name>' 'CentOS-5.7-x86_64-netboot'
25
+ veewee vbox define '<box_name>' 'CentOS-5.8-i386'
26
+ veewee vbox define '<box_name>' 'CentOS-5.8-i386-netboot'
27
+ veewee vbox define '<box_name>' 'CentOS-5.8-x86_64'
28
+ veewee vbox define '<box_name>' 'CentOS-5.8-x86_64-netboot'
23
29
  veewee vbox define '<box_name>' 'CentOS-6.0-i386'
24
30
  veewee vbox define '<box_name>' 'CentOS-6.0-i386-netboot'
25
31
  veewee vbox define '<box_name>' 'CentOS-6.0-x86_64'
26
32
  veewee vbox define '<box_name>' 'CentOS-6.0-x86_64-minimal'
27
33
  veewee vbox define '<box_name>' 'CentOS-6.0-x86_64-netboot'
28
34
  veewee vbox define '<box_name>' 'CentOS-6.1-x86_64-minimal'
35
+ veewee vbox define '<box_name>' 'CentOS-6.1-x86_64-netboot'
36
+ veewee vbox define '<box_name>' 'CentOS-6.2-i386-minimal'
29
37
  veewee vbox define '<box_name>' 'CentOS-6.2-x86_64-minimal'
38
+ veewee vbox define '<box_name>' 'CentOS-6.2-x86_64-netboot'
39
+ veewee vbox define '<box_name>' 'CentOS-6.3-i386-minimal'
40
+ veewee vbox define '<box_name>' 'CentOS-6.3-x86_64-minimal'
30
41
  veewee vbox define '<box_name>' 'Debian-5.0.8-amd64-netboot'
31
42
  veewee vbox define '<box_name>' 'Debian-5.0.8-i386-netboot'
43
+ veewee vbox define '<box_name>' 'Debian-5.0.10-amd64-netboot'
44
+ veewee vbox define '<box_name>' 'Debian-5.0.10-i386-netboot'
32
45
  veewee vbox define '<box_name>' 'Debian-6.0.3-amd64-netboot'
33
46
  veewee vbox define '<box_name>' 'Debian-6.0.3-i386-netboot'
47
+ veewee vbox define '<box_name>' 'Debian-6.0.4-amd64-netboot'
48
+ veewee vbox define '<box_name>' 'Debian-6.0.4-i386-netboot'
49
+ veewee vbox define '<box_name>' 'Debian-6.0.5-amd64-netboot'
50
+ veewee vbox define '<box_name>' 'Debian-6.0.5-i386-netboot'
51
+ veewee vbox define '<box_name>' 'Debian-6.0.6-amd64-netboot'
52
+ veewee vbox define '<box_name>' 'Debian-6.0.6-i386-netboot'
53
+ veewee vbox define '<box_name>' 'Debian-7.0-b2-i386-netboot'
54
+ veewee vbox define '<box_name>' 'Debian-7.0-b3-amd64-netboot'
34
55
  veewee vbox define '<box_name>' 'Fedora-14-amd64'
35
56
  veewee vbox define '<box_name>' 'Fedora-14-amd64-netboot'
36
57
  veewee vbox define '<box_name>' 'Fedora-14-i386'
@@ -41,10 +62,17 @@ To see all the templates provided:
41
62
  veewee vbox define '<box_name>' 'Fedora-15-x86_64-netboot'
42
63
  veewee vbox define '<box_name>' 'Fedora-16-i386'
43
64
  veewee vbox define '<box_name>' 'Fedora-16-x86_64'
65
+ veewee vbox define '<box_name>' 'Fedora-16-x86_64-netboot'
66
+ veewee vbox define '<box_name>' 'Fedora-17-i386'
67
+ veewee vbox define '<box_name>' 'Fedora-17-x86_64'
68
+ veewee vbox define '<box_name>' 'Fedora-18-i386'
69
+ veewee vbox define '<box_name>' 'Fedora-18-x86_64'
44
70
  veewee vbox define '<box_name>' 'freebsd-8.2-experimental'
45
71
  veewee vbox define '<box_name>' 'freebsd-8.2-pcbsd-i386'
46
72
  veewee vbox define '<box_name>' 'freebsd-8.2-pcbsd-i386-netboot'
73
+ veewee vbox define '<box_name>' 'freebsd-9.0-RELEASE-amd64'
47
74
  veewee vbox define '<box_name>' 'funtoo-latest-generic_64-stable'
75
+ veewee vbox define '<box_name>' 'funtoo-latest-x86_64'
48
76
  veewee vbox define '<box_name>' 'gentoo-latest-i386-experimental'
49
77
  veewee vbox define '<box_name>' 'gentoo-latest-x86_64-experimental'
50
78
  veewee vbox define '<box_name>' 'openbsd50_amd64'
@@ -57,8 +85,13 @@ To see all the templates provided:
57
85
  veewee vbox define '<box_name>' 'openSUSE-11.4-NET-x86_64'
58
86
  veewee vbox define '<box_name>' 'openSUSE-12.1-DVD+NET-i586'
59
87
  veewee vbox define '<box_name>' 'openSUSE-12.1-DVD+NET-x86_64'
88
+ veewee vbox define '<box_name>' 'OracleLinux-6.3-x86_64-DVD'
60
89
  veewee vbox define '<box_name>' 'scientificlinux-6.1-i386-netboot'
61
90
  veewee vbox define '<box_name>' 'scientificlinux-6.1-x86_64-netboot'
91
+ veewee vbox define '<box_name>' 'scientificlinux-6.2-i386-netboot'
92
+ veewee vbox define '<box_name>' 'scientificlinux-6.2-x86_64-netboot'
93
+ veewee vbox define '<box_name>' 'scientificlinux-6.3-i386-netboot'
94
+ veewee vbox define '<box_name>' 'scientificlinux-6.3-x86_64-netboot'
62
95
  veewee vbox define '<box_name>' 'SLES-11-SP1-DVD-i586-GM'
63
96
  veewee vbox define '<box_name>' 'SLES-11-SP1-DVD-x86_64-GM'
64
97
  veewee vbox define '<box_name>' 'solaris-11-express-i386'
@@ -68,6 +101,8 @@ To see all the templates provided:
68
101
  veewee vbox define '<box_name>' 'ubuntu-10.04.3-server-amd64'
69
102
  veewee vbox define '<box_name>' 'ubuntu-10.04.3-server-amd64-alt'
70
103
  veewee vbox define '<box_name>' 'ubuntu-10.04.3-server-i386'
104
+ veewee vbox define '<box_name>' 'ubuntu-10.04.4-server-amd64'
105
+ veewee vbox define '<box_name>' 'ubuntu-10.04.4-server-i386'
71
106
  veewee vbox define '<box_name>' 'ubuntu-10.10-server-amd64'
72
107
  veewee vbox define '<box_name>' 'ubuntu-10.10-server-amd64-netboot'
73
108
  veewee vbox define '<box_name>' 'ubuntu-10.10-server-i386'
@@ -77,19 +112,35 @@ To see all the templates provided:
77
112
  veewee vbox define '<box_name>' 'ubuntu-11.10-server-amd64'
78
113
  veewee vbox define '<box_name>' 'ubuntu-11.10-server-amd64-ishaya'
79
114
  veewee vbox define '<box_name>' 'ubuntu-11.10-server-amd64-ruby192'
115
+ veewee vbox define '<box_name>' 'ubuntu-11.10-server-amd64-rvm'
80
116
  veewee vbox define '<box_name>' 'ubuntu-11.10-server-i386'
117
+ veewee vbox define '<box_name>' 'ubuntu-12.04.1-server-amd64'
118
+ veewee vbox define '<box_name>' 'ubuntu-12.04.1-server-amd64-packages'
119
+ veewee vbox define '<box_name>' 'ubuntu-12.04.1-server-i386'
120
+ veewee vbox define '<box_name>' 'ubuntu-12.04.1-server-i386-packages'
121
+ veewee vbox define '<box_name>' 'ubuntu-12.10-server-amd64'
122
+ veewee vbox define '<box_name>' 'ubuntu-12.10-server-amd64-packages'
123
+ veewee vbox define '<box_name>' 'ubuntu-12.10-server-i386'
124
+ veewee vbox define '<box_name>' 'ubuntu-12.10-server-i386-packages'
81
125
  veewee vbox define '<box_name>' 'ubuntu-8.04.4-server-amd64'
82
126
  veewee vbox define '<box_name>' 'ubuntu-8.04.4-server-i386'
83
127
  veewee vbox define '<box_name>' 'windows-2008R1-serverstandard-amd64'
128
+ veewee vbox define '<box_name>' 'windows-2008R1-serverweb-amd64'
129
+ veewee vbox define '<box_name>' 'windows-2008R1-serverwebcore-amd64'
130
+ veewee vbox define '<box_name>' 'windows-2008R1-serverweb-i386'
84
131
  veewee vbox define '<box_name>' 'windows-2008R2-amd64'
85
132
  veewee vbox define '<box_name>' 'windows-2008R2-serverstandard-amd64'
133
+ veewee vbox define '<box_name>' 'windows-2008R2-serverstandard-amd64-winrm'
134
+ veewee vbox define '<box_name>' 'windows-2008R2-serverweb-amd64'
135
+ veewee vbox define '<box_name>' 'windows-2008R2-serverwebcore-amd64'
86
136
  veewee vbox define '<box_name>' 'windows-7-enterprise-amd64'
137
+ veewee vbox define '<box_name>' 'windows-7-enterprise-amd64-winrm'
87
138
  veewee vbox define '<box_name>' 'windows-7-enterprise-i386'
88
139
  veewee vbox define '<box_name>' 'windows-7-premium-amd64'
89
140
  veewee vbox define '<box_name>' 'windows-7-professional-amd64'
90
- veewee vbox define '<box_name>' 'windows-7-ultimate-amd64'
91
141
  veewee vbox define '<box_name>' 'windows-7sp1-ultimate-amd64'
92
- veewee vbox define '<box_name>' 'windows-8-preview-dev-amd64'
142
+ veewee vbox define '<box_name>' 'windows-7-ultimate-amd64'
143
+ veewee vbox define '<box_name>' 'windows-8-preview-amd64'
93
144
 
94
145
 
95
146
  ## Structure
@@ -1,5 +1,20 @@
1
+
2
+
1
3
  module Veewee
2
4
  module Command
5
+ class Fusion < Veewee::Command::GroupBase
6
+ register "add_share", "Adds a Share to the Guest"
7
+ desc "add_share [BOX_NAME] [SHARE_NAME] [SHARE_PATH]", "hello"
8
+ def add_share(box_name, share_name, share_path)
9
+ venv=Veewee::Environment.new(options)
10
+ venv.ui=env.ui
11
+ # command="#{File.dirname().shellescape}/vmware-vdiskmanager -c -s #{definition.disk_size}M -a lsilogic -t #{disk_type} #{name}.vmdk"
12
+ # shell_results=shell_exec("#{command}",{:mute => true})
13
+ venv.providers["vmfusion"].get_box(box_name).add_share(share_name, share_path)
14
+
15
+ end
16
+ end
17
+
3
18
  class Fusion< Veewee::Command::GroupBase
4
19
 
5
20
  register "fusion", "Subcommand for Vmware fusion"
@@ -16,7 +31,7 @@ module Veewee
16
31
  venv.providers["vmfusion"].get_box(box_name).build(options)
17
32
  end
18
33
 
19
- method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "force the destroy"
34
+ method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "force the destroy"
20
35
  method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
21
36
  method_option :nogui,:type => :boolean , :default => false, :aliases => "-n", :desc => "no gui"
22
37
  desc "destroy [BOXNAME]", "Destroys the virtualmachine that was built"
@@ -27,7 +42,7 @@ module Veewee
27
42
  end
28
43
 
29
44
  method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
30
- method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "force the shutdown"
45
+ method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "force the shutdown"
31
46
  desc "halt [BOXNAME]", "Activates a shutdown the virtualmachine"
32
47
  def halt(box_name)
33
48
  venv=Veewee::Environment.new(options)
@@ -52,6 +67,25 @@ module Veewee
52
67
  venv.providers["vmfusion"].get_box(box_name).issh(command)
53
68
  end
54
69
 
70
+
71
+ desc "winrm [BOXNAME] [COMMAND]", "Execute command via winrm"
72
+ method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
73
+ def winrm(box_name,command=nil)
74
+ venv=Veewee::Environment.new(options)
75
+ venv.ui=env.ui
76
+ venv.providers["vmfusion"].get_box(box_name).winrm(command,{:exitcode => "*"})
77
+ end
78
+
79
+ desc "copy [BOXNAME] [SRC] [DST]", "Copy a file to the VM"
80
+ method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
81
+ def copy(box_name,src,dst)
82
+ venv=Veewee::Environment.new(options)
83
+ venv.ui=env.ui
84
+ venv.providers["vmfusion"].get_box(box_name).copy_to_box(src,dst)
85
+ end
86
+
87
+
88
+
55
89
  desc "define [BOXNAME] [TEMPLATE]", "Define a new basebox starting from a template"
56
90
  method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "overwrite the definition"
57
91
  method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
@@ -94,7 +128,7 @@ module Veewee
94
128
  venv=Veewee::Environment.new(options)
95
129
  venv.ui=env.ui
96
130
  venv.ostypes.each do |name|
97
- env.ui.info "- #{name}"
131
+ env.ui.info "- #{name}"
98
132
  end
99
133
  end
100
134
 
@@ -8,6 +8,7 @@ require 'veewee/command/vagrant/destroy'
8
8
  require 'veewee/command/vagrant/up'
9
9
  require 'veewee/command/vagrant/halt'
10
10
  require 'veewee/command/vagrant/ssh'
11
+ require 'veewee/command/vagrant/winrm'
11
12
  require 'veewee/command/vagrant/define'
12
13
  require 'veewee/command/vagrant/undefine'
13
14
  require 'veewee/command/vagrant/validate'
@@ -33,6 +34,7 @@ module Veewee
33
34
  @subcommands.register(:up) { Veewee::Command::Vagrant::Up }
34
35
  @subcommands.register(:halt) { Veewee::Command::Vagrant::Halt }
35
36
  @subcommands.register(:ssh) { Veewee::Command::Vagrant::Ssh }
37
+ @subcommands.register(:winrm) { Veewee::Command::Vagrant::Winrm }
36
38
  @subcommands.register(:define) { Veewee::Command::Vagrant::Define }
37
39
  @subcommands.register(:undefine) { Veewee::Command::Vagrant::Undefine }
38
40
  @subcommands.register(:export) { Veewee::Command::Vagrant::Export }
@@ -0,0 +1,39 @@
1
+ require 'optparse'
2
+
3
+ module Veewee
4
+ module Command
5
+ module Vagrant
6
+ class Winrm < ::Vagrant::Command::Base
7
+ def execute
8
+ options = {}
9
+
10
+ opts = OptionParser.new do |opts|
11
+ opts.banner = "Winrm into the basebox"
12
+ opts.separator ""
13
+ opts.separator "Usage: vagrant basebox winrm <boxname> <command>"
14
+
15
+ opts.on("-d", "--debug", "enable debugging") do |d|
16
+ options['debug'] = d
17
+ end
18
+
19
+ end
20
+
21
+ # Parse the options
22
+ argv = parse_options(opts)
23
+ return if !argv
24
+ raise ::Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1
25
+
26
+ begin
27
+ venv=Veewee::Environment.new(options)
28
+ venv.ui=@env.ui
29
+ venv.providers["virtualbox"].get_box(argv[0]).winrm(argv[1])
30
+ rescue Veewee::Error => ex
31
+ venv.ui.error ex
32
+ exit -1
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -53,6 +53,24 @@ module Veewee
53
53
  venv.providers["virtualbox"].get_box(box_name).issh(command)
54
54
  end
55
55
 
56
+
57
+ desc "winrm [BOXNAME] [COMMAND]", "Execute command via winrm"
58
+ method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
59
+ def winrm(box_name,command=nil)
60
+ venv=Veewee::Environment.new(options)
61
+ venv.ui=env.ui
62
+ venv.providers["virtualbox"].get_box(box_name).winrm(command,{:exitcode => "*"})
63
+ end
64
+
65
+ desc "copy [BOXNAME] [SRC] [DST]", "Copy a file to the VM"
66
+ method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
67
+ def copy(box_name,src,dst)
68
+ venv=Veewee::Environment.new(options)
69
+ venv.ui=env.ui
70
+ venv.providers["virtualbox"].get_box(box_name).copy_to_box(src,dst)
71
+ end
72
+
73
+
56
74
  desc "define [BOXNAME] [TEMPLATE]", "Define a new basebox starting from a template"
57
75
  method_option :force,:type => :boolean , :default => false, :aliases => "-f", :desc => "overwrite the definition"
58
76
  method_option :debug,:type => :boolean , :default => false, :aliases => "-d", :desc => "enable debugging"
@@ -21,6 +21,8 @@ module Veewee
21
21
 
22
22
  attr_accessor :ssh_login_timeout, :ssh_user , :ssh_password, :ssh_key, :ssh_host_port, :ssh_guest_port
23
23
 
24
+ attr_accessor :winrm_login_timeout, :winrm_user , :winrm_password, :winrm_host_port, :winrm_guest_port
25
+
24
26
  attr_accessor :sudo_cmd
25
27
  attr_accessor :shutdown_cmd
26
28
 
@@ -31,14 +33,15 @@ module Veewee
31
33
  attr_accessor :floppy_files
32
34
 
33
35
 
34
- attr_accessor :use_hw_virt_ext,:use_pae,:hostiocache
36
+ attr_accessor :use_hw_virt_ext,:use_pae,:hostiocache, :use_sata
35
37
 
36
38
  attr_accessor :iso_dowload_timeout, :iso_src,:iso_md5 ,:iso_download_instructions
37
39
 
38
40
  attr_accessor :virtualbox
39
41
  attr_accessor :vmfusion
40
42
  attr_accessor :kvm
41
-
43
+ attr_accessor :add_shares
44
+ attr_accessor :vmdk_file
42
45
 
43
46
  def ui
44
47
  return @_ui if defined?(@_ui)
@@ -64,6 +67,9 @@ module Veewee
64
67
  # Default there is no ISO file mounted
65
68
  @iso_file = nil, @iso_src = nil ; @iso_md5 = nil ; @iso_download_timeout=1000 ; @iso_download_instructions = nil
66
69
 
70
+ # Shares to add
71
+ @add_shares = []
72
+
67
73
  # Default is no floppy mounted
68
74
  @floppy_files = nil
69
75
 
@@ -73,6 +79,7 @@ module Veewee
73
79
 
74
80
  @iso_file=""
75
81
  @disk_size = '10240'; @disk_format = 'VDI'; @disk_variant = 'Standard'
82
+ @use_sata = true
76
83
 
77
84
  # :hostiocache => 'off' ,
78
85
  # :os_type_id => 'Ubuntu',
@@ -83,6 +90,9 @@ module Veewee
83
90
  # :ssh_host_port => "2222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
84
91
  # :shutdown_cmd => "shutdown -h now",
85
92
  # :kickstart_file => nil,
93
+ @winrm_host_port = "5985"; @winrm_guest_port = "5985"
94
+ @winrm_login_timeout = "10000"
95
+ @boot_cmd_sequence = [] # Empty list by default
86
96
 
87
97
  @virtualbox={:vm_options => {}}
88
98
  @vmfusion={:vm_options => {}}
@@ -171,7 +181,7 @@ module Veewee
171
181
 
172
182
  # Postinstall files require a valid user and password
173
183
  unless self.postinstall_files.nil?
174
- if self.ssh_user.nil? || self.ssh_password.nil?
184
+ if (self.ssh_user.nil? || self.ssh_password.nil?) && (self.winrm_user.nil? || self.winrm_password.nil?)
175
185
  return false
176
186
  end
177
187
  end
@@ -17,6 +17,9 @@ module Veewee
17
17
 
18
18
  class SshError < Error
19
19
  end
20
+
21
+ class WinrmError < Error
22
+ end
20
23
  end
21
24
 
22
25
  #Usage (from the exceptional ruby book)
@@ -3,15 +3,20 @@ require 'veewee/provider/core/helper/ssh'
3
3
  require 'veewee/provider/core/helper/web'
4
4
  require 'veewee/provider/core/helper/shell'
5
5
  require 'veewee/provider/core/helper/iso'
6
+ require 'veewee/provider/core/helper/winrm'
7
+ require 'veewee/provider/core/helper/comm'
6
8
 
7
9
  require 'veewee/provider/core/box/build'
8
10
  require 'veewee/provider/core/box/scp'
11
+ require 'veewee/provider/core/box/wincp'
12
+ require 'veewee/provider/core/box/copy'
9
13
  require 'veewee/provider/core/box/exec'
10
14
  require 'veewee/provider/core/box/poweroff'
11
15
  require 'veewee/provider/core/box/halt'
12
16
  require 'veewee/provider/core/box/sudo'
13
17
  require 'veewee/provider/core/box/ssh'
14
18
  require 'veewee/provider/core/box/issh'
19
+ require 'veewee/provider/core/box/winrm'
15
20
  require 'veewee/provider/core/box/floppy'
16
21
  require 'veewee/provider/core/box/validate_tags'
17
22
 
@@ -28,6 +33,8 @@ module Veewee
28
33
  include ::Veewee::Provider::Core::Helper::Web
29
34
  include ::Veewee::Provider::Core::Helper::Shell
30
35
  include ::Veewee::Provider::Core::Helper::Ssh
36
+ include ::Veewee::Provider::Core::Helper::Winrm
37
+ include ::Veewee::Provider::Core::Helper::Comm
31
38
  include ::Veewee::Provider::Core::Helper::Iso
32
39
 
33
40
  include ::Veewee::Provider::Core::BoxCommand