I currently utilize Vagrant and Chef to provision individual linux VMs for different apps.
These apps are domain addressable from host, without requiring anything else set up on the host. This is achieved using avahi on the linux guest. Host then accesses via guest's hostname, such as:
myguest1.local -> VM#1
myguest2.local -> VM#2
I now have another app about to install, which to replicate the production server, should have 2 Apache virtual hosts addressable within the one VM, such as:
myguest3.local
-> VM#3
myguest4.local
Can I also achieve this completely with Vagrant/Chef, without needing any modification to the host machine?
There is a Vagrant plugin for that : vagrant-hostsupdater
Extract from the github page :
There is also vagrant-hostmanager, which supports Windows machines. I have not use it, so any feedback is welcome.
Extract from it's github page :
So it seems that both plugins automate the process of adding entries to
/etc/hosts
It'll certainly work, but you will need to manually set entries for the virtual hosts in your hosts' /etc/hosts file. That should be the only step required on the host machine.
You can announce the alias via the Avahi API with Avahi.EntryGroup.AddRecord: python example.
A detailed solution for using the script is provided on SO