lib/kitchen/driver/vagrant.rb in kitchen-vagrant-0.9.0 vs lib/kitchen/driver/vagrant.rb in kitchen-vagrant-0.10.0
- old
+ new
@@ -33,27 +33,36 @@
# @todo Vagrant installation check and version will be placed into any
# dependency hook checks when feature is released
class Vagrant < Kitchen::Driver::SSHBase
default_config :customize, {:memory => '256'}
+ default_config :synced_folders, {}
required_config :box
no_parallel_for :create, :destroy
def create(state)
create_vagrantfile
- run "vagrant up --no-provision"
+ cmd = "vagrant up --no-provision"
+ cmd += " --provider=#{@config[:provider]}" if @config[:provider]
+ run cmd
set_ssh_state(state)
info("Vagrant instance #{instance.to_str} created.")
end
def converge(state)
create_vagrantfile
ssh_args = build_ssh_args(state)
install_omnibus(ssh_args) if config[:require_chef_omnibus]
- run "vagrant provision"
+ if config[:use_vagrant_provision]
+ run "vagrant provision"
+ else
+ prepare_chef_home(ssh_args)
+ upload_chef_data(ssh_args)
+ run_chef_solo(ssh_args)
+ end
end
def setup(state)
create_vagrantfile
super
@@ -75,10 +84,10 @@
state.delete(:hostname)
end
def verify_dependencies
check_vagrant_version
- check_berkshelf_plugin
+ check_berkshelf_plugin if config[:use_vagrant_berkshelf_plugin]
end
protected
WEBSITE = "http://downloads.vagrantup.com/"