Hello Uli.

1. On RedHat and Centos, you can stop the OS changing /etc/hosts, but in
Ubuntu you can't.
So you can use a shell provisioner to set /etc/hosts.

Shell provisioner by default only run once, but you can specify to run
always.

Have a look at his gist, I am not sure you need dnsmasq at all if you
create the hosts in all the nodes.

https://gist.github.com/kikitux/805f58ae1f7fb30e5109

If I did miss anything, please let me know :)


Alvaro.


On Fri, Jan 1, 2016 at 2:48 AM, Uli Schulze-Eyssing <[email protected]>
wrote:

> Hi,
> I would like to create a network of 4 VMs, connected through a private
> network.
>
>  node.vm.network :private_network, ip: "10.211.55.10[1-n]"
>  node.vm.hostname = "vm[1-n]"
>
>
> for every node did the job. It created a second private nic as expected.
>
> I use the hostmanager plugin to exchange the hostnames in the /etc/hosts.
>
>
>   config.hostmanager.enabled = false
>   config.hostmanager.manage_host = true
>   config.hostmanager.include_offline = true
>   config.hostmanager.ignore_private_ip = false
>
>
> and
>
>
>  node.vm.provision :hostmanager
>
>
> Now I can ping the boxes among themselves by hostname, but for some reason
> I need complete dns.
>
> ping vm[1-n]
>
> works, but
>
> host vm[1-n]
>
> doesn´t work.
>
> Two points:
> I´m running vagrant on a windows box. (vagrant-dns wouldn´t work)
> I don´t wanna have too much dependencies into the host setup in respect to
> future deployments.
>
> So I remove hostmanager and try to set up a dnsmasq and a proper
> /etc/hosts on one of the VMs and a proper nameserver setting on the others.
> So here I´m stuck. I cannot configure the resolving properly.
>
> So, what I need on the "client" VMs is something like:
>
> iface eth1 inet static
>       address 10.211.55.102
>       netmask 255.255.255.0
>       dns-nameservers 10.211.55.100
>
>
>
> in my /etc/networks/interfaces and disabling the nameserver for the first
> interface. The /etc/resolv.conf should look like:
>
> # Dynamic resolv.conf(5) file for glibc resolver(3) generated by
> resolvconf(8)
> #     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
> nameserver 10.211.55.100
> search localnet
>
>
> By default, the first interface in in here at the first position.
>
>
> Here my questions:
>
> Ist there a way to specify the nameservers for my private networks? For
> example a parameter witch sets "dns-nameservers" in my
> /etc/networks/interfaces.
> Is there a possibility to disable the nameserver of my first (default!?!)
> interface? This is the nat/dhcp interface configured by vagrant by default.
>
> Thanks,
> Uli
>
>
>
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/a4d019b1-3fb7-4e22-aab4-91fb995f6281%40googlegroups.com
> <https://groups.google.com/d/msgid/vagrant-up/a4d019b1-3fb7-4e22-aab4-91fb995f6281%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ezb60OZowiC%3Dxs1e3OosO_1pfcu1gO-cY%2BypGzM5FRrPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to