vagrant-landrush / landrush

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

Add command to clear all entries at once #262

Closed ezekg closed 7 years ago

ezekg commented 7 years ago

I've had multiple instances where a virtual machine fails somehow (be it testing provisioning scripts, random errors, etc.) causing Landrush to leave hanging entries. Then in order to work with another virtual machine using the same tld/ip, I have to manually remove all of Landrush's entries.

Currently, you're forced to run vagrant landrush ls, grab the top-most entry and then vagrant landrush rm $entry tens of times to clean it all out.

Could we add a vagrant landrush clean command or something similar?

I'll do the PR if you don't have time.

hferentschik commented 7 years ago

Thanks, I like the idea. I have run into the "stale entries" issue myself several times. I think I'd prefer a flag for the tm command though. WDYT?

landrush rm --all

That said, did you know you can at any stage just edit the configuration file which backs the host config. You find it in ~/.vagrant.d/data/landrush/hosts.json. You can edit it with your favorite editor in order to clean it up or even delete it altogether between restarts. That's a bit easier than using landrush rm with a lot of entries.

I'll do the PR if you don't have time.

If you have time, please send a pull request. Contributions are always welcome.

ezekg commented 7 years ago

Great. I like landrush rm --all better as well. I didn't think to look for a data file anywhere, so that's good to know. I'll work on putting together a pull request soon.

hferentschik commented 7 years ago

Fixed by pull request #287

ezekg commented 7 years ago

Hey, thanks for wrapping this up! Sorry I wasn't able to get to it.