vagrant-hostmanager 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,9 +39,11 @@ module VagrantPlugins
|
|
39
39
|
# copy the hosts file to each matching machine
|
40
40
|
# TODO append hostname to loopback address
|
41
41
|
matching_machines.each do |machine|
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
if machine.communicate.ready?
|
43
|
+
env[:ui].info @translator.t('update', { :name => machine.name })
|
44
|
+
machine.communicate.upload(path, '/tmp/hosts')
|
45
|
+
machine.communicate.sudo("mv /tmp/hosts /etc/hosts")
|
46
|
+
end
|
45
47
|
end
|
46
48
|
|
47
49
|
@app.call(env)
|
data/test/test.sh
CHANGED
@@ -5,6 +5,10 @@ echo "[server1] /etc/hosts file:"
|
|
5
5
|
vagrant ssh server1 -c 'cat /etc/hosts'
|
6
6
|
echo "[server2] /etc/hosts file:"
|
7
7
|
vagrant ssh server2 -c 'cat /etc/hosts'
|
8
|
+
|
9
|
+
vagrant halt
|
10
|
+
vagrant up
|
11
|
+
|
8
12
|
vagrant destroy server1 -f
|
9
13
|
echo "[server2] /etc/hosts file:"
|
10
14
|
vagrant ssh server2 -c 'cat /etc/hosts'
|