nixops icon indicating copy to clipboard operation
nixops copied to clipboard

Add the possiblity to define extra hosts aliases

Open MartinPotier opened this issue 8 years ago • 3 comments

nixops generates an /etc/hosts referring to all machines by IP. That'd be usefull, in the case of virtualbox instances at least, to be able to declare extra aliases. Using the following fragment:

machineName.deployment.targetExtraAliases = ["alias1" "alias2"];

would generate the following /etc/hosts on machineName:

127.0.0.1  localhost
::1  localhost

…
192.168.xx.xx machineName machineName-unencrypted alias1 alias2
…

Doing so could relieve users from installing and running a local DNS server for the task.

MartinPotier avatar Dec 21 '17 11:12 MartinPotier

It's possible to workaround this by doing this:

{
    networking.extraHosts = "${nodes."NODE NAME".config.networking.privateIPv4} ALIAS";
}

sugar700 avatar Oct 12 '19 11:10 sugar700

+1 and a bump for 2021. It would be nice to get this for free.

WhittlesJr avatar Mar 19 '21 21:03 WhittlesJr

Actually, to co-opt this a bit, it doesn't seem like nixops is adding the other machines to /etc/hosts at all... is that really supposed to be a feature?

WhittlesJr avatar Mar 19 '21 21:03 WhittlesJr