Check if machines are ready for SSH communication.
This commit is contained in:
parent
e08fc6a811
commit
5865b1ac27
|
@ -39,9 +39,11 @@ module VagrantPlugins
|
|||
# copy the hosts file to each matching machine
|
||||
# TODO append hostname to loopback address
|
||||
matching_machines.each do |machine|
|
||||
env[:ui].info @translator.t('update', { :name => machine.name })
|
||||
machine.communicate.upload(path, '/tmp/hosts')
|
||||
machine.communicate.sudo("mv /tmp/hosts /etc/hosts")
|
||||
if machine.communicate.ready?
|
||||
env[:ui].info @translator.t('update', { :name => machine.name })
|
||||
machine.communicate.upload(path, '/tmp/hosts')
|
||||
machine.communicate.sudo("mv /tmp/hosts /etc/hosts")
|
||||
end
|
||||
end
|
||||
|
||||
@app.call(env)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module VagrantPlugins
|
||||
module HostManager
|
||||
VERSION = '0.0.2'
|
||||
VERSION = '0.0.3'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,6 +5,10 @@ echo "[server1] /etc/hosts file:"
|
|||
vagrant ssh server1 -c 'cat /etc/hosts'
|
||||
echo "[server2] /etc/hosts file:"
|
||||
vagrant ssh server2 -c 'cat /etc/hosts'
|
||||
|
||||
vagrant halt
|
||||
vagrant up
|
||||
|
||||
vagrant destroy server1 -f
|
||||
echo "[server2] /etc/hosts file:"
|
||||
vagrant ssh server2 -c 'cat /etc/hosts'
|
||||
|
|
Loading…
Reference in New Issue