Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Option to append host aliases on a single line instead of every alias in its own line #294

Open
danowar2k opened this issue May 31, 2024 · 1 comment

Comments

@danowar2k
Copy link

I'm not sure if the current method can lead to bad behaviour.

Currently, using the aliases option...

Vagrantfile:

vm_config.vm.hostname = some-hostname
vm_config.hostmanager.aliases = %W(some-hostname.some-domain some-other-alias)

leads to the following lines (concrete IP not important):

1.2.3.4 some-hostname
1.2.3.4 some-hostname.some-domain
1.2.3.4 some-other-alias

I don't know if the resolving process will get problems with this, but I've heard that the stuff should be on the same line for an IP. Like this:

1.2.3.4 some-hostname some-hostname.some-domain some-other-alias

How about at least an option with which to select which way will be used?

@danowar2k
Copy link
Author

danowar2k commented May 31, 2024

It looks like if the option is defined, it would only be need to be used here:

"#{ip}\t#{host}\n" + aliases.map{|a| "#{ip}\t#{a}"}.join("\n") + "\n"

To decide whether to do newlines for each alias or not (and whether to prefix the entry with IP, okay, it's a little more complex to build the string)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant