vagrant-landrush / landrush

A Vagrant plugin that provides a simple DNS server for Vagrant guests
MIT License
666 stars 78 forks source link

Static entries persist after vagrant destroy #221

Open ajpaul25 opened 8 years ago

ajpaul25 commented 8 years ago

Using the following in my Vagrantfile: config.landrush.host "testentry", "10.10.10.10"

This properly creates a static entry for testentry along with a dynamic entry for the box corresponding with my Vagrantfile. Upon issuing vagrant destroy, my dynamic entry is removed, but the static entry remains in landrush.

hferentschik commented 8 years ago

Static entries are "static". They need to be added and removed explicitly. Landrush does not know which static entries it can delete when a VM gets destroyed. The host config file contains just names to IP. When a VM gets destroyed we can remove the IP of the VM, since we know the VM's IP and can remove the relevant entry. For static entries this is not the case.

Any reason why you want the static entries to be removed? Do you have a use case?

ajpaul25 commented 8 years ago

After your explanation on static entries, I guess this sounds more like an enhancement than a bug.

My intention is to use the config.landrush.host setting to set a cname for a vagrant box that answers based upon the host url. (Think apache and virtual servers.) That feature is currently broken in the 1.0 release, but it looks like it's been fixed and will be released with 1.1 (Issue #176). In the meantime, I'm experimenting with the setting using an ip address.

Once the box has been destroyed, the dns entry would no longer be valid and should not persist. I can understand where a persistent static entry could be useful on a host running vagrant and landrush. However, I also feel as though any changes made by executing vagrant up should be reverted by the execution of vagrant destroy.

hferentschik commented 6 years ago

To make this happen, one would need to do some reference counting and only if there are not more other references for a static entry on the time of the vagrant destroy one would be able to delete the entry. Possible, but not sure whether it is worth the effort.