mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Create and activate networks if needed when starting VM. Closes #116
This commit is contained in:
parent
2ac0855a1f
commit
6e8c43e300
@ -57,14 +57,18 @@ module VagrantPlugins
|
||||
next if env[:result]
|
||||
|
||||
b2.use Call, IsSuspended do |env2, b3|
|
||||
# if vm is suspended resume it then exit
|
||||
if env2[:result]
|
||||
b3.use ResumeDomain
|
||||
next
|
||||
end
|
||||
|
||||
# VM is not running or suspended. Start it.. Machine should gain
|
||||
# IP address when comming up, so wait for dhcp lease and store IP
|
||||
# into machines data_dir.
|
||||
# VM is not running or suspended.
|
||||
|
||||
# Ensure networks are created and active
|
||||
b3.use CreateNetworks
|
||||
|
||||
# Handle shared folders
|
||||
if Vagrant::VERSION < "1.4.0"
|
||||
b3.use NFS
|
||||
else
|
||||
@ -74,7 +78,11 @@ module VagrantPlugins
|
||||
b3.use PrepareNFSSettings
|
||||
b3.use ShareFolders
|
||||
|
||||
# Start it..
|
||||
b3.use StartDomain
|
||||
|
||||
# Machine should gain IP address when comming up,
|
||||
# so wait for dhcp lease and store IP into machines data_dir.
|
||||
b3.use WaitTillUp
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user