Closed tmoschou closed 3 years ago
Oddly I can see that the plugin does get called on vagrant destroy
, just not vagrant up
$ vagrant destroy
node-2: Are you sure you want to destroy the 'node-2' VM? [y/N] y
==> node-2: Forcing shutdown of VM...
==> node-2: Destroying VM and associated drives...
==> node-2: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines...
==> node-2: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)...
Password:
node-1: Are you sure you want to destroy the 'node-1' VM? [y/N] y
==> node-1: Forcing shutdown of VM...
==> node-1: Destroying VM and associated drives...
==> node-1: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines...
==> node-1: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)...
Looks like a regression in vagrant
https://github.com/hashicorp/vagrant/issues/12035
should be resolved in vagrant 2.2.14
Hi @tmoschou, thanks for digging into this - we'll await the 2.2.14 release.
Running 2.2.14, I am experiencing an update to the vagrant box hosts file, but not the hosts. Can anyone else confirm this was resolved for them in 2.2.14?
Problem appears to be fixed in 2.2.14.
Vagrant.configure("2") do |config|
config.hostmanager.enable = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
config.vm.define "master" do |master|
master.vm.box = "centos/7"
master.vm.hostname = "master.home.test"
master.vm.synced_folder ".", "/vagrant", disabled: true
master.vm.network :private_network, ip: "10.1.20.60", hostname: true
master.hostmanager.aliases = %w(master.home.test master)
[vagrant@master ~]$ cat /etc/hosts
10.1.20.60 master.home.test master
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
The plugin does not modify the guest or host /etc/hosts file on the latest version.
Vagrant file:
No entries are modified on the host's (macOS) /etc/hosts. Likewise for the guests:
The first line is managed by vagrant itself through he
hostname: true
option tonode.vm.network
. Normally there would be an entry for node-2 in a block managed by the plugin at the end.