Giter VIP home page Giter VIP logo

vagrant-hostsupdater's Introduction

Vagrant::Hostsupdater

This plugin adds an entry to your /etc/hosts file on the host system.

On up, resume and reload commands, it tries to add the information, if its not already existant in your hosts file. If it needs to be added, you will be asked for an administrator password, since it uses sudo to edit the file.

On halt and destroy, those entries will be removed again. By setting the remove_on_suspend option, you can have them removed on suspend, too:

config.hostsupdater.remove_on_suspend = true

Installation

$ vagrant plugin install vagrant-hostsupdater

Uninstall it with:

$ vagrant plugin uninstall vagrant-hostsupdater

Usage

At the moment, the only things you need, are the hostname and a :private_network network with a fixed ip.

config.vm.network :private_network, ip: "192.168.3.10"
config.vm.hostname = "www.testing.de"
config.hostsupdater.aliases = ["alias.testing.de", "alias2.somedomain.com"]

This ip and the hostname will be used for the entry in the /etc/hosts file.

Versions

0.0.11

  • bugfix: Fix additional new lines being added to hosts file (Thanks to vincentmac)

0.0.10

  • bugfix: wrong path on Windows systems (Thanks to Im0rtality)

0.0.9

  • bugfix: now not trying to remove anything if no machine id is given

0.0.8

  • trying to use proper windows hosts file

0.0.7

  • using hashed uids now to identify hosts entries (you might need to remove previous hostentries manually)
  • fixed removing of host entries

0.0.6

  • no sudo, if /etc/hosts is writeable

0.0.5

  • option added to not remove hosts on suspend, adding hosts on resume (Thanks to Svelix)

0.0.4

  • fixed problem with removing hosts entries on destroy command (Thanks to Andy Bohne)

0.0.3

  • added aliases config option to define additional hostnames

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

vagrant-hostsupdater's People

Contributors

agiledivider avatar im0rtality avatar mal avatar svelix avatar vincentmac avatar suin avatar

Watchers

Nap Ramirez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.