vagrantup 0.8.10 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (325) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +77 -1
  3. data/Gemfile +0 -14
  4. data/LICENSE +1 -1
  5. data/bin/vagrant +47 -20
  6. data/config/default.rb +6 -14
  7. data/lib/vagrant/action/box/destroy.rb +7 -3
  8. data/lib/vagrant/action/box/download.rb +8 -8
  9. data/lib/vagrant/action/box/package.rb +2 -2
  10. data/lib/vagrant/action/box/unpackage.rb +13 -7
  11. data/lib/vagrant/action/box/verify.rb +5 -5
  12. data/lib/vagrant/action/builder.rb +23 -19
  13. data/lib/vagrant/action/builtin.rb +117 -79
  14. data/lib/vagrant/action/env/set.rb +7 -4
  15. data/lib/vagrant/action/environment.rb +3 -41
  16. data/lib/vagrant/action/general/package.rb +14 -29
  17. data/lib/vagrant/action/general/validate.rb +2 -2
  18. data/lib/vagrant/action/runner.rb +53 -0
  19. data/lib/vagrant/action/vm/boot.rb +9 -9
  20. data/lib/vagrant/action/vm/check_accessible.rb +2 -2
  21. data/lib/vagrant/action/vm/check_box.rb +10 -12
  22. data/lib/vagrant/action/vm/check_guest_additions.rb +8 -8
  23. data/lib/vagrant/action/vm/check_port_collisions.rb +85 -0
  24. data/lib/vagrant/action/vm/clean_machine_folder.rb +4 -4
  25. data/lib/vagrant/action/vm/clear_forwarded_ports.rb +3 -11
  26. data/lib/vagrant/action/vm/clear_network_interfaces.rb +31 -0
  27. data/lib/vagrant/action/vm/clear_shared_folders.rb +2 -11
  28. data/lib/vagrant/action/vm/customize.rb +19 -9
  29. data/lib/vagrant/action/vm/destroy.rb +4 -4
  30. data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +2 -12
  31. data/lib/vagrant/action/vm/discard_state.rb +4 -4
  32. data/lib/vagrant/action/vm/export.rb +13 -8
  33. data/lib/vagrant/action/vm/forward_ports.rb +55 -102
  34. data/lib/vagrant/action/vm/halt.rb +9 -6
  35. data/lib/vagrant/action/vm/host_name.rb +4 -4
  36. data/lib/vagrant/action/vm/import.rb +19 -10
  37. data/lib/vagrant/action/vm/match_mac_address.rb +4 -9
  38. data/lib/vagrant/action/vm/network.rb +300 -94
  39. data/lib/vagrant/action/vm/nfs.rb +41 -26
  40. data/lib/vagrant/action/vm/package.rb +1 -1
  41. data/lib/vagrant/action/vm/package_vagrantfile.rb +5 -2
  42. data/lib/vagrant/action/vm/provision.rb +42 -13
  43. data/lib/vagrant/action/vm/provisioner_cleanup.rb +2 -2
  44. data/lib/vagrant/action/vm/{clear_nfs_exports.rb → prune_nfs_exports.rb} +7 -7
  45. data/lib/vagrant/action/vm/resume.rb +4 -4
  46. data/lib/vagrant/action/vm/setup_package_files.rb +54 -0
  47. data/lib/vagrant/action/vm/share_folders.rb +63 -39
  48. data/lib/vagrant/action/vm/suspend.rb +4 -4
  49. data/lib/vagrant/action/warden.rb +13 -6
  50. data/lib/vagrant/action.rb +45 -123
  51. data/lib/vagrant/box.rb +9 -55
  52. data/lib/vagrant/box_collection.rb +22 -17
  53. data/lib/vagrant/cli.rb +62 -47
  54. data/lib/vagrant/command/base.rb +135 -90
  55. data/lib/vagrant/command/box.rb +46 -21
  56. data/lib/vagrant/command/box_add.rb +33 -0
  57. data/lib/vagrant/command/box_list.rb +25 -0
  58. data/lib/vagrant/command/box_remove.rb +23 -0
  59. data/lib/vagrant/command/box_repackage.rb +23 -0
  60. data/lib/vagrant/command/destroy.rb +16 -5
  61. data/lib/vagrant/command/halt.rb +25 -7
  62. data/lib/vagrant/command/init.rb +30 -7
  63. data/lib/vagrant/command/package.rb +49 -18
  64. data/lib/vagrant/command/provision.rb +22 -9
  65. data/lib/vagrant/command/reload.rb +18 -5
  66. data/lib/vagrant/command/resume.rb +18 -5
  67. data/lib/vagrant/command/ssh.rb +69 -31
  68. data/lib/vagrant/command/ssh_config.rb +37 -22
  69. data/lib/vagrant/command/status.rb +22 -20
  70. data/lib/vagrant/command/suspend.rb +18 -5
  71. data/lib/vagrant/command/up.rb +41 -8
  72. data/lib/vagrant/command.rb +18 -20
  73. data/lib/vagrant/communication/base.rb +56 -0
  74. data/lib/vagrant/communication/ssh.rb +200 -0
  75. data/lib/vagrant/communication.rb +7 -0
  76. data/lib/vagrant/config/base.rb +18 -26
  77. data/lib/vagrant/config/container.rb +37 -0
  78. data/lib/vagrant/config/error_recorder.rb +1 -1
  79. data/lib/vagrant/config/loader.rb +125 -0
  80. data/lib/vagrant/config/nfs.rb +1 -3
  81. data/lib/vagrant/config/package.rb +1 -3
  82. data/lib/vagrant/config/ssh.rb +31 -16
  83. data/lib/vagrant/config/top.rb +36 -25
  84. data/lib/vagrant/config/vagrant.rb +2 -5
  85. data/lib/vagrant/config/vm/provisioner.rb +16 -20
  86. data/lib/vagrant/config/vm/sub_vm.rb +1 -1
  87. data/lib/vagrant/config/vm.rb +115 -56
  88. data/lib/vagrant/config.rb +29 -103
  89. data/lib/vagrant/data_store.rb +23 -15
  90. data/lib/vagrant/downloaders/base.rb +7 -5
  91. data/lib/vagrant/downloaders/file.rb +4 -4
  92. data/lib/vagrant/downloaders/http.rb +4 -5
  93. data/lib/vagrant/driver/virtualbox.rb +121 -0
  94. data/lib/vagrant/driver/virtualbox_4_0.rb +411 -0
  95. data/lib/vagrant/driver/virtualbox_4_1.rb +411 -0
  96. data/lib/vagrant/driver/virtualbox_base.rb +284 -0
  97. data/lib/vagrant/driver.rb +7 -0
  98. data/lib/vagrant/environment.rb +221 -240
  99. data/lib/vagrant/errors.rb +74 -25
  100. data/lib/vagrant/guest/arch.rb +48 -0
  101. data/lib/vagrant/{systems → guest}/base.rb +30 -18
  102. data/lib/vagrant/guest/debian.rb +61 -0
  103. data/lib/vagrant/{systems → guest}/freebsd.rb +11 -18
  104. data/lib/vagrant/guest/gentoo.rb +32 -0
  105. data/lib/vagrant/{systems → guest}/linux/config.rb +2 -4
  106. data/lib/vagrant/guest/linux/error.rb +9 -0
  107. data/lib/vagrant/guest/linux.rb +78 -0
  108. data/lib/vagrant/guest/redhat.rb +66 -0
  109. data/lib/vagrant/guest/solaris.rb +114 -0
  110. data/lib/vagrant/{systems → guest}/suse.rb +2 -2
  111. data/lib/vagrant/guest/ubuntu.rb +23 -0
  112. data/lib/vagrant/guest.rb +16 -0
  113. data/lib/vagrant/hosts/arch.rb +7 -3
  114. data/lib/vagrant/hosts/base.rb +36 -46
  115. data/lib/vagrant/hosts/bsd.rb +53 -16
  116. data/lib/vagrant/hosts/fedora.rb +14 -0
  117. data/lib/vagrant/hosts/freebsd.rb +6 -36
  118. data/lib/vagrant/hosts/linux.rb +45 -20
  119. data/lib/vagrant/hosts/windows.rb +16 -0
  120. data/lib/vagrant/hosts.rb +23 -6
  121. data/lib/vagrant/provisioners/base.rb +11 -34
  122. data/lib/vagrant/provisioners/chef.rb +30 -26
  123. data/lib/vagrant/provisioners/chef_client.rb +37 -23
  124. data/lib/vagrant/provisioners/chef_solo.rb +61 -16
  125. data/lib/vagrant/provisioners/puppet.rb +70 -38
  126. data/lib/vagrant/provisioners/puppet_server.rb +12 -13
  127. data/lib/vagrant/provisioners/shell.rb +24 -24
  128. data/lib/vagrant/provisioners.rb +10 -7
  129. data/lib/vagrant/registry.rb +49 -0
  130. data/lib/vagrant/ssh.rb +82 -153
  131. data/lib/vagrant/ui.rb +118 -50
  132. data/lib/vagrant/util/busy.rb +1 -1
  133. data/lib/vagrant/util/file_mode.rb +12 -0
  134. data/lib/vagrant/util/network_ip.rb +28 -0
  135. data/lib/vagrant/util/platform.rb +1 -0
  136. data/lib/vagrant/util/subprocess.rb +227 -0
  137. data/lib/vagrant/version.rb +1 -1
  138. data/lib/vagrant/vm.rb +111 -97
  139. data/lib/vagrant.rb +132 -5
  140. data/tasks/acceptance.rake +3 -3
  141. data/tasks/test.rake +7 -2
  142. data/templates/commands/init/Vagrantfile.erb +11 -4
  143. data/templates/{ssh_config.erb → commands/ssh_config/config.erb} +0 -0
  144. data/templates/guests/arch/network_dhcp.erb +7 -0
  145. data/templates/guests/arch/network_static.erb +7 -0
  146. data/templates/guests/debian/network_dhcp.erb +6 -0
  147. data/templates/guests/debian/network_static.erb +7 -0
  148. data/templates/guests/gentoo/network_dhcp.erb +4 -0
  149. data/templates/guests/gentoo/network_static.erb +4 -0
  150. data/templates/guests/redhat/network_dhcp.erb +6 -0
  151. data/templates/guests/redhat/network_static.erb +7 -0
  152. data/templates/locales/en.yml +241 -122
  153. data/templates/{chef_server_client.erb → provisioners/chef_client/client.erb} +0 -0
  154. data/templates/{chef_solo_solo.erb → provisioners/chef_solo/solo.erb} +0 -0
  155. data/test/acceptance/base.rb +10 -10
  156. data/test/acceptance/box_test.rb +28 -6
  157. data/test/acceptance/destroy_test.rb +1 -1
  158. data/test/acceptance/halt_test.rb +4 -4
  159. data/test/acceptance/init_test.rb +3 -3
  160. data/test/acceptance/networking/host_only_test.rb +37 -0
  161. data/test/acceptance/networking/port_forward_test.rb +125 -0
  162. data/test/acceptance/package_test.rb +46 -0
  163. data/test/acceptance/provisioning/basic_test.rb +61 -0
  164. data/test/acceptance/provisioning/chef_solo_test.rb +37 -0
  165. data/test/acceptance/provisioning/shell_test.rb +53 -0
  166. data/test/acceptance/resume_test.rb +1 -1
  167. data/test/acceptance/skeletons/chef_solo_basic/README.md +3 -0
  168. data/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +5 -0
  169. data/test/acceptance/skeletons/chef_solo_json/README.md +3 -0
  170. data/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +6 -0
  171. data/test/acceptance/skeletons/provisioner_multi/README.md +3 -0
  172. data/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +5 -0
  173. data/test/acceptance/ssh_test.rb +7 -2
  174. data/test/acceptance/support/config.rb +1 -1
  175. data/test/acceptance/support/isolated_environment.rb +41 -150
  176. data/test/acceptance/support/matchers/match_output.rb +1 -1
  177. data/test/acceptance/support/matchers/succeed.rb +14 -0
  178. data/test/acceptance/support/network_tests.rb +29 -0
  179. data/test/acceptance/support/output.rb +9 -1
  180. data/test/acceptance/support/shared/base_context.rb +16 -9
  181. data/test/acceptance/support/shared/command_examples.rb +4 -4
  182. data/test/acceptance/suspend_test.rb +1 -1
  183. data/test/acceptance/up_basic_test.rb +26 -7
  184. data/test/acceptance/up_with_box_url.rb +1 -1
  185. data/test/acceptance/vagrant_test.rb +1 -1
  186. data/test/acceptance/version_test.rb +0 -5
  187. data/test/support/isolated_environment.rb +46 -0
  188. data/test/{acceptance/support → support}/tempdir.rb +0 -0
  189. data/test/unit/base.rb +21 -0
  190. data/test/unit/support/isolated_environment.rb +39 -0
  191. data/test/unit/support/shared/base_context.rb +30 -0
  192. data/test/unit/vagrant/action/builder_test.rb +126 -177
  193. data/test/unit/vagrant/action/environment_test.rb +10 -21
  194. data/test/unit/vagrant/action/runner_test.rb +65 -0
  195. data/test/unit/vagrant/action/warden_test.rb +64 -97
  196. data/test/unit/vagrant/box_collection_test.rb +44 -33
  197. data/test/unit/vagrant/box_test.rb +25 -65
  198. data/test/unit/vagrant/command/base_test.rb +141 -14
  199. data/test/unit/vagrant/config/base_test.rb +16 -43
  200. data/test/unit/vagrant/config/loader_test.rb +79 -0
  201. data/test/unit/vagrant/config/top_test.rb +69 -0
  202. data/test/unit/vagrant/config/vm_test.rb +62 -47
  203. data/test/unit/vagrant/config_test.rb +16 -151
  204. data/test/unit/vagrant/data_store_test.rb +43 -61
  205. data/test/unit/vagrant/downloaders/base_test.rb +12 -22
  206. data/test/unit/vagrant/downloaders/file_test.rb +58 -31
  207. data/test/unit/vagrant/downloaders/http_test.rb +12 -86
  208. data/test/unit/vagrant/environment_test.rb +107 -536
  209. data/test/unit/vagrant/hosts_test.rb +36 -0
  210. data/test/unit/vagrant/registry_test.rb +56 -0
  211. data/test/unit/vagrant/util/file_checksum_test.rb +23 -0
  212. data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +23 -24
  213. data/test/unit/vagrant/util/network_ip_test.rb +17 -0
  214. data/test/unit/vagrant/util/retryable_test.rb +90 -34
  215. data/test/unit/vagrant_test.rb +27 -0
  216. data/test/{unit → unit_legacy}/locales/en.yml +0 -0
  217. data/test/{unit → unit_legacy}/test_helper.rb +0 -0
  218. data/test/{unit → unit_legacy}/vagrant/action/box/destroy_test.rb +0 -0
  219. data/test/{unit → unit_legacy}/vagrant/action/box/download_test.rb +0 -0
  220. data/test/{unit → unit_legacy}/vagrant/action/box/package_test.rb +0 -0
  221. data/test/{unit → unit_legacy}/vagrant/action/box/unpackage_test.rb +0 -0
  222. data/test/{unit → unit_legacy}/vagrant/action/box/verify_test.rb +0 -0
  223. data/test/{unit → unit_legacy}/vagrant/action/env/set_test.rb +0 -0
  224. data/test/{unit → unit_legacy}/vagrant/action/general/package_test.rb +0 -0
  225. data/test/{unit → unit_legacy}/vagrant/action/general/validate_test.rb +0 -0
  226. data/test/{unit → unit_legacy}/vagrant/action/vm/boot_test.rb +0 -0
  227. data/test/{unit → unit_legacy}/vagrant/action/vm/check_accessible_test.rb +0 -0
  228. data/test/{unit → unit_legacy}/vagrant/action/vm/check_box_test.rb +0 -0
  229. data/test/{unit → unit_legacy}/vagrant/action/vm/check_guest_additions_test.rb +0 -0
  230. data/test/{unit → unit_legacy}/vagrant/action/vm/clean_machine_folder_test.rb +0 -0
  231. data/test/{unit → unit_legacy}/vagrant/action/vm/clear_forwarded_ports_test.rb +0 -0
  232. data/test/{unit → unit_legacy}/vagrant/action/vm/clear_nfs_exports_test.rb +0 -0
  233. data/test/{unit → unit_legacy}/vagrant/action/vm/clear_shared_folders_test.rb +0 -0
  234. data/test/{unit → unit_legacy}/vagrant/action/vm/customize_test.rb +0 -0
  235. data/test/{unit → unit_legacy}/vagrant/action/vm/destroy_test.rb +0 -0
  236. data/test/{unit → unit_legacy}/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +0 -0
  237. data/test/{unit → unit_legacy}/vagrant/action/vm/discard_state_test.rb +0 -0
  238. data/test/{unit → unit_legacy}/vagrant/action/vm/export_test.rb +0 -0
  239. data/test/{unit → unit_legacy}/vagrant/action/vm/forward_ports_helpers_test.rb +0 -0
  240. data/test/{unit → unit_legacy}/vagrant/action/vm/forward_ports_test.rb +0 -0
  241. data/test/{unit → unit_legacy}/vagrant/action/vm/halt_test.rb +0 -0
  242. data/test/{unit → unit_legacy}/vagrant/action/vm/host_name_test.rb +0 -0
  243. data/test/{unit → unit_legacy}/vagrant/action/vm/import_test.rb +0 -0
  244. data/test/{unit → unit_legacy}/vagrant/action/vm/match_mac_address_test.rb +0 -0
  245. data/test/{unit → unit_legacy}/vagrant/action/vm/modify_test.rb +0 -0
  246. data/test/{unit → unit_legacy}/vagrant/action/vm/network_test.rb +0 -0
  247. data/test/{unit → unit_legacy}/vagrant/action/vm/nfs_helpers_test.rb +0 -0
  248. data/test/{unit → unit_legacy}/vagrant/action/vm/nfs_test.rb +0 -0
  249. data/test/{unit → unit_legacy}/vagrant/action/vm/package_test.rb +0 -0
  250. data/test/{unit → unit_legacy}/vagrant/action/vm/package_vagrantfile_test.rb +0 -0
  251. data/test/{unit → unit_legacy}/vagrant/action/vm/provision_test.rb +0 -0
  252. data/test/{unit → unit_legacy}/vagrant/action/vm/provisioner_cleanup_test.rb +0 -0
  253. data/test/{unit → unit_legacy}/vagrant/action/vm/resume_test.rb +0 -0
  254. data/test/{unit → unit_legacy}/vagrant/action/vm/share_folders_test.rb +0 -0
  255. data/test/{unit → unit_legacy}/vagrant/action/vm/suspend_test.rb +0 -0
  256. data/test/{unit → unit_legacy}/vagrant/action_test.rb +0 -0
  257. data/test/unit_legacy/vagrant/box_collection_test.rb +45 -0
  258. data/test/unit_legacy/vagrant/box_test.rb +74 -0
  259. data/test/{unit → unit_legacy}/vagrant/cli_test.rb +0 -0
  260. data/test/unit_legacy/vagrant/command/base_test.rb +23 -0
  261. data/test/{unit → unit_legacy}/vagrant/command/group_base_test.rb +0 -0
  262. data/test/{unit → unit_legacy}/vagrant/command/helpers_test.rb +0 -0
  263. data/test/{unit → unit_legacy}/vagrant/command/init_test.rb +0 -0
  264. data/test/{unit → unit_legacy}/vagrant/command/package_test.rb +0 -0
  265. data/test/unit_legacy/vagrant/config/base_test.rb +52 -0
  266. data/test/{unit → unit_legacy}/vagrant/config/error_recorder_test.rb +0 -0
  267. data/test/{unit → unit_legacy}/vagrant/config/ssh_test.rb +0 -0
  268. data/test/{unit → unit_legacy}/vagrant/config/vagrant_test.rb +0 -0
  269. data/test/{unit → unit_legacy}/vagrant/config/vm/provisioner_test.rb +0 -0
  270. data/test/unit_legacy/vagrant/config/vm_test.rb +47 -0
  271. data/test/unit_legacy/vagrant/config_test.rb +148 -0
  272. data/test/unit_legacy/vagrant/downloaders/http_test.rb +93 -0
  273. data/test/unit_legacy/vagrant/environment_test.rb +539 -0
  274. data/test/{unit → unit_legacy}/vagrant/errors_test.rb +0 -0
  275. data/test/{unit → unit_legacy}/vagrant/hosts/base_test.rb +0 -0
  276. data/test/{unit → unit_legacy}/vagrant/hosts/bsd_test.rb +0 -0
  277. data/test/{unit → unit_legacy}/vagrant/hosts/linux_test.rb +0 -0
  278. data/test/{unit → unit_legacy}/vagrant/plugin_test.rb +0 -0
  279. data/test/{unit → unit_legacy}/vagrant/provisioners/base_test.rb +0 -0
  280. data/test/{unit → unit_legacy}/vagrant/provisioners/chef_client_test.rb +0 -0
  281. data/test/{unit → unit_legacy}/vagrant/provisioners/chef_solo_test.rb +0 -0
  282. data/test/{unit → unit_legacy}/vagrant/provisioners/chef_test.rb +0 -0
  283. data/test/{unit → unit_legacy}/vagrant/provisioners/puppet_server_test.rb +0 -0
  284. data/test/{unit → unit_legacy}/vagrant/provisioners/puppet_test.rb +0 -0
  285. data/test/{unit → unit_legacy}/vagrant/provisioners/shell_test.rb +0 -0
  286. data/test/{unit → unit_legacy}/vagrant/ssh/session_test.rb +0 -0
  287. data/test/{unit → unit_legacy}/vagrant/ssh_test.rb +0 -0
  288. data/test/{unit → unit_legacy}/vagrant/systems/base_test.rb +0 -0
  289. data/test/{unit → unit_legacy}/vagrant/systems/linux_test.rb +0 -0
  290. data/test/{unit → unit_legacy}/vagrant/util/busy_test.rb +0 -0
  291. data/test/{unit → unit_legacy}/vagrant/util/counter_test.rb +0 -0
  292. data/test/{unit → unit_legacy}/vagrant/util/platform_test.rb +0 -0
  293. data/test/{unit → unit_legacy}/vagrant/util/stacked_proc_runner_test.rb +0 -0
  294. data/test/{unit → unit_legacy}/vagrant/util/template_renderer_test.rb +0 -0
  295. data/test/{unit → unit_legacy}/vagrant/vm_test.rb +0 -0
  296. data/vagrant.gemspec +7 -9
  297. metadata +183 -179
  298. data/keys/vagrant.ppk +0 -26
  299. data/lib/vagrant/action/box.rb +0 -11
  300. data/lib/vagrant/action/env.rb +0 -7
  301. data/lib/vagrant/action/general.rb +0 -8
  302. data/lib/vagrant/action/vm/forward_ports_helpers.rb +0 -28
  303. data/lib/vagrant/action/vm/modify.rb +0 -37
  304. data/lib/vagrant/action/vm/nfs_helpers.rb +0 -11
  305. data/lib/vagrant/action/vm.rb +0 -34
  306. data/lib/vagrant/command/group_base.rb +0 -107
  307. data/lib/vagrant/command/helpers.rb +0 -33
  308. data/lib/vagrant/command/named_base.rb +0 -14
  309. data/lib/vagrant/command/upgrade_to_060.rb +0 -45
  310. data/lib/vagrant/command/version.rb +0 -13
  311. data/lib/vagrant/ssh/session.rb +0 -136
  312. data/lib/vagrant/systems/arch.rb +0 -34
  313. data/lib/vagrant/systems/debian.rb +0 -36
  314. data/lib/vagrant/systems/gentoo.rb +0 -27
  315. data/lib/vagrant/systems/linux/error.rb +0 -9
  316. data/lib/vagrant/systems/linux.rb +0 -82
  317. data/lib/vagrant/systems/redhat.rb +0 -48
  318. data/lib/vagrant/systems/solaris.rb +0 -113
  319. data/lib/vagrant/systems/ubuntu.rb +0 -17
  320. data/lib/vagrant/systems.rb +0 -13
  321. data/templates/network_entry_arch.erb +0 -9
  322. data/templates/network_entry_debian.erb +0 -8
  323. data/templates/network_entry_gentoo.erb +0 -5
  324. data/templates/network_entry_redhat.erb +0 -9
  325. data/test/unit/vagrant/ui_test.rb +0 -29
data/lib/vagrant/vm.rb CHANGED
@@ -1,100 +1,98 @@
1
+ require 'log4r'
2
+
1
3
  module Vagrant
2
4
  class VM
3
5
  include Vagrant::Util
4
6
 
7
+ attr_reader :uuid
5
8
  attr_reader :env
6
9
  attr_reader :name
7
10
  attr_reader :vm
8
-
9
- class << self
10
- # Finds a virtual machine by a given UUID and either returns
11
- # a Vagrant::VM object or returns nil.
12
- def find(uuid, env=nil, name=nil)
13
- vm = VirtualBox::VM.find(uuid)
14
- new(:vm => vm, :env => env, :name => name)
11
+ attr_reader :box
12
+ attr_reader :config
13
+ attr_reader :driver
14
+
15
+ def initialize(name, env, config, opts=nil)
16
+ @logger = Log4r::Logger.new("vagrant::vm")
17
+
18
+ @name = name
19
+ @vm = nil
20
+ @env = env
21
+ @config = config
22
+ @box = env.boxes.find(config.vm.box)
23
+
24
+ opts ||= {}
25
+ if opts[:base]
26
+ # The name is the ID we use.
27
+ @uuid = name
28
+ else
29
+ # Load the UUID if its saved.
30
+ active = env.local_data[:active] || {}
31
+ @uuid = active[@name.to_s]
15
32
  end
16
- end
17
-
18
- def initialize(opts=nil)
19
- defaults = {
20
- :vm => nil,
21
- :env => nil,
22
- :name => nil
23
- }
24
33
 
25
- opts = defaults.merge(opts || {})
34
+ # Reload ourselves to get the state
35
+ reload!
26
36
 
27
- @vm = opts[:vm]
28
- @name = opts[:name]
29
-
30
- if !opts[:env].nil?
31
- # We have an environment, so we create a new child environment
32
- # specifically for this VM. This step will load any custom
33
- # config and such.
34
- @env = Vagrant::Environment.new({
35
- :cwd => opts[:env].cwd,
36
- :parent => opts[:env],
37
- :vm => self
38
- }).load!
39
-
40
- # Load the associated system.
41
- load_system!
42
- end
43
-
44
- @loaded_system_distro = false
37
+ # Load the associated guest.
38
+ load_guest!
39
+ @loaded_guest_distro = false
45
40
  end
46
41
 
47
- # Loads the system associated with the VM. The system class is
42
+ # Loads the guest associated with the VM. The guest class is
48
43
  # responsible for OS-specific functionality. More information
49
- # can be found by reading the documentation on {Vagrant::Systems::Base}.
44
+ # can be found by reading the documentation on {Vagrant::Guest::Base}.
50
45
  #
51
46
  # **This method should never be called manually.**
52
- def load_system!(system=nil)
53
- system ||= env.config.vm.system
54
- env.logger.info("vm: #{name}") { "Loading system: #{system}" }
55
-
56
- if system.is_a?(Class)
57
- raise Errors::VMSystemError, :_key => :invalid_class, :system => system.to_s if !(system <= Systems::Base)
58
- @system = system.new(self)
59
- elsif system.is_a?(Symbol)
60
- # Hard-coded internal systems
61
- mapping = {
62
- :debian => Systems::Debian,
63
- :ubuntu => Systems::Ubuntu,
64
- :freebsd => Systems::FreeBSD,
65
- :gentoo => Systems::Gentoo,
66
- :redhat => Systems::Redhat,
67
- :suse => Systems::Suse,
68
- :linux => Systems::Linux,
69
- :solaris => Systems::Solaris,
70
- :arch => Systems::Arch
71
- }
72
-
73
- raise Errors::VMSystemError, :_key => :unknown_type, :system => system.to_s if !mapping.has_key?(system)
74
- @system = mapping[system].new(self)
47
+ def load_guest!(guest=nil)
48
+ guest ||= config.vm.guest
49
+ @logger.info("Loading guest: #{guest}")
50
+
51
+ if guest.is_a?(Class)
52
+ raise Errors::VMGuestError, :_key => :invalid_class, :system => guest.to_s if !(guest <= Systems::Base)
53
+ @guest = guest.new(self)
54
+ elsif guest.is_a?(Symbol)
55
+ guest_klass = Vagrant.guests.get(guest)
56
+ raise Errors::VMGuestError, :_key => :unknown_type, :system => guest.to_s if !guest_klass
57
+ @guest = guest_klass.new(self)
75
58
  else
76
- raise Errors::VMSystemError, :unspecified
59
+ raise Errors::VMGuestError, :unspecified
77
60
  end
78
61
  end
79
62
 
80
- # Returns the system for this VM, loading the distro of the system if
63
+ # Returns a channel object to communicate with the virtual
64
+ # machine.
65
+ def channel
66
+ @channel ||= Communication::SSH.new(self)
67
+ end
68
+
69
+ # Returns the guest for this VM, loading the distro of the system if
81
70
  # we can.
82
- def system
83
- if !@loaded_system_distro && created? && vm.running?
84
- # Load the system distro for the first time
85
- result = @system.distro_dispatch
86
- load_system!(result)
87
- @loaded_system_distro = true
71
+ def guest
72
+ if !@loaded_guest_distro && state == :running
73
+ # Load the guest distro for the first time
74
+ result = @guest.distro_dispatch
75
+ load_guest!(result)
76
+ @loaded_guest_distro = true
88
77
  end
89
78
 
90
- @system
79
+ @guest
91
80
  end
92
81
 
93
- # Access the {Vagrant::SSH} object associated with this VM.
94
- # On the initial call, this will initialize the object. On
95
- # subsequent calls it will reuse the existing object.
82
+ # Access the {Vagrant::SSH} object associated with this VM, which
83
+ # is used to get SSH credentials with the virtual machine.
96
84
  def ssh
97
- @ssh ||= SSH.new(env)
85
+ @ssh ||= SSH.new(self)
86
+ end
87
+
88
+ # Returns the state of the VM as a symbol.
89
+ #
90
+ # @return [Symbol]
91
+ def state
92
+ return :not_created if !@uuid
93
+ state = @driver.read_state
94
+ return :not_created if !state
95
+ return state
98
96
  end
99
97
 
100
98
  # Returns a boolean true if the VM has been created, otherwise
@@ -102,19 +100,17 @@ module Vagrant
102
100
  #
103
101
  # @return [Boolean]
104
102
  def created?
105
- !vm.nil?
103
+ state != :not_created
106
104
  end
107
105
 
108
106
  # Sets the currently active VM for this VM. If the VM is a valid,
109
107
  # created virtual machine, then it will also update the local data
110
108
  # to persist the VM. Otherwise, it will remove itself from the
111
109
  # local data (if it exists).
112
- def vm=(value)
113
- @vm = value
110
+ def uuid=(value)
114
111
  env.local_data[:active] ||= {}
115
-
116
- if value && value.uuid
117
- env.local_data[:active][name.to_s] = value.uuid
112
+ if value
113
+ env.local_data[:active][name.to_s] = value
118
114
  else
119
115
  env.local_data[:active].delete(name.to_s)
120
116
  end
@@ -122,60 +118,78 @@ module Vagrant
122
118
  # Commit the local data so that the next time vagrant is initialized,
123
119
  # it realizes the VM exists
124
120
  env.local_data.commit
125
- end
126
121
 
127
- def uuid
128
- vm ? vm.uuid : nil
122
+ # Store the uuid and reload the instance
123
+ @uuid = value
124
+ reload!
129
125
  end
130
126
 
131
127
  def reload!
132
- @vm = VirtualBox::VM.find(@vm.uuid)
128
+ begin
129
+ @driver = Driver::VirtualBox.new(@uuid)
130
+ rescue Driver::VirtualBox::VMNotFound
131
+ # Clear the UUID since this VM doesn't exist. Note that this calls
132
+ # back into `reload!` but shouldn't ever result in infinite
133
+ # recursion since `@uuid` will be nil.
134
+ self.uuid = nil
135
+ end
133
136
  end
134
137
 
135
138
  def package(options=nil)
136
- env.actions.run(:package, { "validate" => false }.merge(options || {}))
139
+ run_action(:package, { "validate" => false }.merge(options || {}))
137
140
  end
138
141
 
139
142
  def up(options=nil)
140
- env.actions.run(:up, options)
143
+ run_action(:up, options)
141
144
  end
142
145
 
143
146
  def start(options=nil)
144
- raise Errors::VMInaccessible if !@vm.accessible?
145
- return if @vm.running?
146
- return resume if @vm.saved?
147
+ return if state == :running
148
+ return resume if state == :saved
147
149
 
148
- env.actions.run(:start, options)
150
+ run_action(:start, options)
149
151
  end
150
152
 
151
153
  def halt(options=nil)
152
- env.actions.run(:halt, options)
154
+ run_action(:halt, options)
153
155
  end
154
156
 
155
157
  def reload
156
- env.actions.run(:reload)
158
+ run_action(:reload)
157
159
  end
158
160
 
159
161
  def provision
160
- env.actions.run(:provision)
162
+ run_action(:provision)
161
163
  end
162
164
 
163
165
  def destroy
164
- env.actions.run(:destroy)
166
+ run_action(:destroy)
165
167
  end
166
168
 
167
169
  def suspend
168
- env.actions.run(:suspend)
170
+ run_action(:suspend)
169
171
  end
170
172
 
171
173
  def resume
172
- env.actions.run(:resume)
174
+ run_action(:resume)
173
175
  end
174
176
 
175
- def saved?
176
- @vm.saved?
177
+ def ui
178
+ return @_ui if defined?(@_ui)
179
+ @_ui = @env.ui.dup
180
+ @_ui.resource = @name
181
+ @_ui
177
182
  end
178
183
 
179
- def powered_off?; @vm.powered_off? end
184
+ protected
185
+
186
+ def run_action(name, options=nil)
187
+ options = {
188
+ :vm => self,
189
+ :ui => ui
190
+ }.merge(options || {})
191
+
192
+ env.action_runner.run(name, options)
193
+ end
180
194
  end
181
195
  end
data/lib/vagrant.rb CHANGED
@@ -1,7 +1,36 @@
1
+ # Enable logging if it is requested. We do this before
2
+ # anything else so that we can setup the output before
3
+ # any logging occurs.
4
+ if ENV["VAGRANT_LOG"] && ENV["VAGRANT_LOG"] != ""
5
+ # Require Log4r and define the levels we'll be using
6
+ require 'log4r'
7
+ require 'log4r/config'
8
+ Log4r.define_levels(*Log4r::Log4rConfig::LogLevels)
9
+
10
+ level = nil
11
+ begin
12
+ level = Log4r.const_get(ENV["VAGRANT_LOG"].upcase)
13
+ rescue NameError
14
+ # This means that the logging constant wasn't found,
15
+ # which is fine. We just keep `level` as `nil`. But
16
+ # we tell the user.
17
+ $stderr.puts "Invalid VAGRANT_LOG level is set: #{ENV["VAGRANT_LOG"]}"
18
+ end
19
+
20
+ # Set the logging level on all "vagrant" namespaced
21
+ # logs as long as we have a valid level.
22
+ if level
23
+ logger = Log4r::Logger.new("vagrant")
24
+ logger.outputters = Log4r::Outputter.stdout
25
+ logger.level = level
26
+ logger = nil
27
+ end
28
+ end
29
+
1
30
  require 'pathname'
31
+ require 'childprocess'
2
32
  require 'json'
3
33
  require 'i18n'
4
- require 'virtualbox'
5
34
 
6
35
  # OpenSSL must be loaded here since when it is loaded via `autoload`
7
36
  # there are issues with ciphers not being properly loaded.
@@ -12,13 +41,19 @@ module Vagrant
12
41
  autoload :Box, 'vagrant/box'
13
42
  autoload :BoxCollection, 'vagrant/box_collection'
14
43
  autoload :CLI, 'vagrant/cli'
44
+ autoload :Command, 'vagrant/command'
45
+ autoload :Communication, 'vagrant/communication'
15
46
  autoload :Config, 'vagrant/config'
16
47
  autoload :DataStore, 'vagrant/data_store'
17
48
  autoload :Downloaders, 'vagrant/downloaders'
49
+ autoload :Driver, 'vagrant/driver'
18
50
  autoload :Environment, 'vagrant/environment'
19
51
  autoload :Errors, 'vagrant/errors'
52
+ autoload :Guest, 'vagrant/guest'
20
53
  autoload :Hosts, 'vagrant/hosts'
21
54
  autoload :Plugin, 'vagrant/plugin'
55
+ autoload :Provisioners, 'vagrant/provisioners'
56
+ autoload :Registry, 'vagrant/registry'
22
57
  autoload :SSH, 'vagrant/ssh'
23
58
  autoload :TestHelpers, 'vagrant/test_helpers'
24
59
  autoload :UI, 'vagrant/ui'
@@ -30,15 +65,107 @@ module Vagrant
30
65
  def self.source_root
31
66
  @source_root ||= Pathname.new(File.expand_path('../../', __FILE__))
32
67
  end
68
+
69
+ # Global registry of commands that are available via the CLI.
70
+ #
71
+ # This registry is used to look up the sub-commands that are available
72
+ # to Vagrant.
73
+ def self.commands
74
+ @commands ||= Registry.new
75
+ end
76
+
77
+ # Global registry of config keys that are available.
78
+ #
79
+ # This registry is used to look up the keys for `config` objects.
80
+ # For example, `config.vagrant` looks up the `:vagrant` config key
81
+ # for the configuration class to use.
82
+ def self.config_keys
83
+ @config_keys ||= Registry.new
84
+ end
85
+
86
+ # Global registry of available host classes and shortcut symbols
87
+ # associated with them.
88
+ #
89
+ # This registry is used to look up the shorcuts for `config.vagrant.host`,
90
+ # or to query all hosts for automatically detecting the host system.
91
+ # The registry is global to all of Vagrant.
92
+ def self.hosts
93
+ @hosts ||= Registry.new
94
+ end
95
+
96
+ # Global registry of available guest classes and shortcut symbols
97
+ # associated with them.
98
+ #
99
+ # This registry is used to look up the shortcuts for `config.vm.guest`.
100
+ def self.guests
101
+ @guests ||= Registry.new
102
+ end
103
+
104
+ # Global registry of provisioners.
105
+ #
106
+ # This registry is used to look up the provisioners provided for
107
+ # `config.vm.provision`.
108
+ def self.provisioners
109
+ @provisioners ||= Registry.new
110
+ end
33
111
  end
34
112
 
35
113
  # # Default I18n to load the en locale
36
114
  I18n.load_path << File.expand_path("templates/locales/en.yml", Vagrant.source_root)
37
115
 
116
+ # Register the built-in commands
117
+ Vagrant.commands.register(:box) { Vagrant::Command::Box }
118
+ Vagrant.commands.register(:destroy) { Vagrant::Command::Destroy }
119
+ Vagrant.commands.register(:halt) { Vagrant::Command::Halt }
120
+ Vagrant.commands.register(:init) { Vagrant::Command::Init }
121
+ Vagrant.commands.register(:package) { Vagrant::Command::Package }
122
+ Vagrant.commands.register(:provision) { Vagrant::Command::Provision }
123
+ Vagrant.commands.register(:reload) { Vagrant::Command::Reload }
124
+ Vagrant.commands.register(:resume) { Vagrant::Command::Resume }
125
+ Vagrant.commands.register(:ssh) { Vagrant::Command::SSH }
126
+ Vagrant.commands.register(:"ssh-config") { Vagrant::Command::SSHConfig }
127
+ Vagrant.commands.register(:status) { Vagrant::Command::Status }
128
+ Vagrant.commands.register(:suspend) { Vagrant::Command::Suspend }
129
+ Vagrant.commands.register(:up) { Vagrant::Command::Up }
130
+
131
+ # Register the built-in config keys
132
+ Vagrant.config_keys.register(:vagrant) { Vagrant::Config::VagrantConfig }
133
+ Vagrant.config_keys.register(:ssh) { Vagrant::Config::SSHConfig }
134
+ Vagrant.config_keys.register(:nfs) { Vagrant::Config::NFSConfig }
135
+ Vagrant.config_keys.register(:vm) { Vagrant::Config::VMConfig }
136
+ Vagrant.config_keys.register(:package) { Vagrant::Config::PackageConfig }
137
+
138
+ # Register the built-in hosts
139
+ Vagrant.hosts.register(:arch) { Vagrant::Hosts::Arch }
140
+ Vagrant.hosts.register(:bsd) { Vagrant::Hosts::BSD }
141
+ Vagrant.hosts.register(:fedora) { Vagrant::Hosts::Fedora }
142
+ Vagrant.hosts.register(:freebsd) { Vagrant::Hosts::FreeBSD }
143
+ Vagrant.hosts.register(:linux) { Vagrant::Hosts::Linux }
144
+ Vagrant.hosts.register(:windows) { Vagrant::Hosts::Windows }
145
+
146
+ # Register the built-in guests
147
+ Vagrant.guests.register(:arch) { Vagrant::Guest::Arch }
148
+ Vagrant.guests.register(:debian) { Vagrant::Guest::Debian }
149
+ Vagrant.guests.register(:freebsd) { Vagrant::Guest::FreeBSD }
150
+ Vagrant.guests.register(:gentoo) { Vagrant::Guest::Gentoo }
151
+ Vagrant.guests.register(:linux) { Vagrant::Guest::Linux }
152
+ Vagrant.guests.register(:redhat) { Vagrant::Guest::Redhat }
153
+ Vagrant.guests.register(:solaris) { Vagrant::Guest::Solaris }
154
+ Vagrant.guests.register(:suse) { Vagrant::Guest::Suse }
155
+ Vagrant.guests.register(:ubuntu) { Vagrant::Guest::Ubuntu }
156
+
157
+ # Register the built-in provisioners
158
+ Vagrant.provisioners.register(:chef_solo) { Vagrant::Provisioners::ChefSolo }
159
+ Vagrant.provisioners.register(:chef_client) { Vagrant::Provisioners::ChefClient }
160
+ Vagrant.provisioners.register(:puppet) { Vagrant::Provisioners::Puppet }
161
+ Vagrant.provisioners.register(:puppet_server) { Vagrant::Provisioners::PuppetServer }
162
+ Vagrant.provisioners.register(:shell) { Vagrant::Provisioners::Shell }
163
+
164
+ # Register the built-in systems
165
+ Vagrant.config_keys.register(:freebsd) { Vagrant::Guest::FreeBSD::FreeBSDConfig }
166
+ Vagrant.config_keys.register(:linux) { Vagrant::Guest::Linux::LinuxConfig }
167
+ Vagrant.config_keys.register(:solaris) { Vagrant::Guest::Solaris::SolarisConfig }
168
+
38
169
  # Load the things which must be loaded before anything else.
39
- require 'vagrant/command'
40
- require 'vagrant/provisioners'
41
- require 'vagrant/systems'
42
170
  require 'vagrant/version'
43
- Vagrant::Action.builtin!
44
171
  Vagrant::Plugin.load!
@@ -12,7 +12,7 @@ namespace :acceptance do
12
12
  desc "Downloads the boxes required for running the acceptance tests."
13
13
  task :boxes, :directory do |t, args|
14
14
  # Create the directory where the boxes will be downloaded
15
- box_dir = Pathname.new(args[:directory] || File.expand_path("../../test/tmp/boxes", __FILE__))
15
+ box_dir = Pathname.new(args[:directory] || File.expand_path("../../boxes", __FILE__))
16
16
  box_dir.mkpath
17
17
  puts "Boxes will be placed in: #{box_dir}"
18
18
 
@@ -73,10 +73,10 @@ namespace :acceptance do
73
73
  desc "Generates the configuration for acceptance tests from current source."
74
74
  task :config, :box_dir do |t, args|
75
75
  require File.expand_path("../../lib/vagrant/version", __FILE__)
76
- require File.expand_path('../../test/acceptance/support/tempdir', __FILE__)
76
+ require File.expand_path('../../test/support/tempdir', __FILE__)
77
77
 
78
78
  # Get the directory for the boxes
79
- box_dir = Pathname.new(args[:box_dir] || File.expand_path("../../test/tmp/boxes", __FILE__))
79
+ box_dir = Pathname.new(args[:box_dir] || File.expand_path("../../boxes", __FILE__))
80
80
 
81
81
  # Generate the binstubs for the Vagrant binary
82
82
  tempdir = Tempdir.new
data/tasks/test.rake CHANGED
@@ -2,12 +2,17 @@ require 'rake/testtask'
2
2
  require 'rspec/core/rake_task'
3
3
 
4
4
  namespace :test do
5
- Rake::TestTask.new do |t|
5
+ RSpec::Core::RakeTask.new do |t|
6
6
  t.name = "unit"
7
- t.libs << "test/unit"
8
7
  t.pattern = "test/unit/**/*_test.rb"
9
8
  end
10
9
 
10
+ Rake::TestTask.new do |t|
11
+ t.name = "unit_old"
12
+ t.libs << "test/unit_legacy"
13
+ t.pattern = "test/unit_legacy/**/*_test.rb"
14
+ end
15
+
11
16
  RSpec::Core::RakeTask.new do |t|
12
17
  t.name = "acceptance"
13
18
  t.pattern = "test/acceptance/**/*_test.rb"
@@ -16,13 +16,20 @@ Vagrant::Config.run do |config|
16
16
  # Boot with a GUI so you can see the screen. (Default is headless)
17
17
  # config.vm.boot_mode = :gui
18
18
 
19
- # Assign this VM to a host only network IP, allowing you to access it
20
- # via the IP.
21
- # config.vm.network "33.33.33.10"
19
+ # Assign this VM to a host-only network IP, allowing you to access it
20
+ # via the IP. Host-only networks can talk to the host machine as well as
21
+ # any other machines on the same network, but cannot be accessed (through this
22
+ # network interface) by any external networks.
23
+ # config.vm.network :hostonly, "33.33.33.10"
24
+
25
+ # Assign this VM to a bridged network, allowing you to connect directly to a
26
+ # network using the host's network device. This makes the VM appear as another
27
+ # physical device on your network.
28
+ # config.vm.network :bridged
22
29
 
23
30
  # Forward a port from the guest to the host, which allows for outside
24
31
  # computers to access the VM, whereas host only networking does not.
25
- # config.vm.forward_port "http", 80, 8080
32
+ # config.vm.forward_port 80, 8080
26
33
 
27
34
  # Share an additional folder to the guest VM. The first argument is
28
35
  # an identifier, the second is the path on the guest to mount the
@@ -0,0 +1,7 @@
1
+ #VAGRANT-BEGIN
2
+ # The contents below are automatically generated by Vagrant. Do not modify.
3
+ interface=eth<%= options[:interface] %>
4
+ address=
5
+ netmask=
6
+ gateway=
7
+ #VAGRANT-END
@@ -0,0 +1,7 @@
1
+ #VAGRANT-BEGIN
2
+ # The contents below are automatically generated by Vagrant. Do not modify.
3
+ interface=eth<%= options[:interface] %>
4
+ address=<%= options[:ip]%>
5
+ netmask=<%= options[:netmask] %>
6
+ gateway=
7
+ #VAGRANT-END
@@ -0,0 +1,6 @@
1
+ #VAGRANT-BEGIN
2
+ # The contents below are automatically generated by Vagrant. Do not modify.
3
+ auto eth<%= options[:interface] %>
4
+ iface eth<%= options[:interface] %> inet dhcp
5
+ post-up route del default dev $IFACE
6
+ #VAGRANT-END
@@ -0,0 +1,7 @@
1
+ #VAGRANT-BEGIN
2
+ # The contents below are automatically generated by Vagrant. Do not modify.
3
+ auto eth<%= options[:interface] %>
4
+ iface eth<%= options[:interface] %> inet static
5
+ address <%= options[:ip] %>
6
+ netmask <%= options[:netmask] %>
7
+ #VAGRANT-END
@@ -0,0 +1,4 @@
1
+ #VAGRANT-BEGIN
2
+ # The contents below are automatically generated by Vagrant. Do not modify.
3
+ config_eth<%= options[:interface] %>="dhcp"
4
+ #VAGRANT-END
@@ -0,0 +1,4 @@
1
+ #VAGRANT-BEGIN
2
+ # The contents below are automatically generated by Vagrant. Do not modify.
3
+ config_eth<%= options[:interface] %>=("<%= options[:ip] %> netmask <%= options[:netmask] %>")
4
+ #VAGRANT-END
@@ -0,0 +1,6 @@
1
+ #VAGRANT-BEGIN
2
+ # The contents below are automatically generated by Vagrant. Do not modify.
3
+ BOOTPROTO=dhcp
4
+ ONBOOT=yes
5
+ DEVICE=eth<%= options[:interface] %>
6
+ #VAGRANT-END
@@ -0,0 +1,7 @@
1
+ #VAGRANT-BEGIN
2
+ # The contents below are automatically generated by Vagrant. Do not modify.
3
+ BOOTPROTO=static
4
+ IPADDR=<%= options[:ip] %>
5
+ NETMASK=<%= options[:netmask] %>
6
+ DEVICE=eth<%= options[:interface] %>
7
+ #VAGRANT-END