Skip to content

Guest hosts files do not get configured with vagrant-hostmanager-1.8.4 #209

@bowlofeggs

Description

@bowlofeggs

Hello! I'm the Fedora package maintainer for vagrant-hostmanager. I was working today on updating Fedora to 1.8.4, and I noticed that the guest in my simple test did not get its hosts file updated with 1.8.4. Fedora 24 currently has 1.8.2 and with that version the guest's hosts file does get updated. FWIW, I am testing with vagrant-libvirt. I noticed that there was some discussion with 1.8.3 that different vagrant backends might not use the same language to describe whether the box is running, so it is possible that this issue is specific to vagrant-libvirt.

Here is a small Vagrantfile I've been testing with:

Vagrant.configure(2) do |config|
  config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-libvirt.box"
  config.vm.box = "f23-cloud-libvirt"

  config.hostmanager.enabled = true
  config.hostmanager.manage_host = true

  config.vm.provision "shell", inline: "cat /etc/hosts"

end

When I run that on an F24 box with 1.8.2, the cat command output looks like this:

==> default: Running provisioner: shell...
    default: Running: inline script
==> default: 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
==> default: ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
==> default: 
==> default: ## vagrant-hostmanager-start
==> default: 192.168.121.248    default
==> default: 
==> default: ## vagrant-hostmanager-end

With 1.8.4, it looks like this:

==> default: Running provisioner: shell...
    default: Running: inline script
==> default: 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
==> default: ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

My guess is that we need some additional string for vagrant-libvirt, similar to what was done in this commit: df35eb2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions