devopsgroup-io / vagrant-hostmanager

:pencil: A Vagrant plugin that manages hosts files within a multi-machine environment.
Mozilla Public License 2.0
1.46k stars 146 forks source link

Please add aliases_on_separate_lines again #170

Open kupferk opened 9 years ago

kupferk commented 9 years ago

I am using Vagrant with vagrant-hostmanagrer and I use Puppet for provisioning. Since the /etc/hosts file now contains multiple entries for a single line, with the pure hostname being the last line, Puppet cannot figure out the hosts domain any more.

So I'd prefer to have the aliases again in a single line. It would be great if the option could be readded again.

ChinnoDog commented 8 years ago

The linux "hostname -f" command also returns the wrong result if they are on separate lines. Since many software packages depend on this command this is a problem.

seth-reeser commented 8 years ago

This was never an option - however we can revisit. There are known issues with too many aliases for OSX and Windows. This will require a decent amount of architecting.

danowar2k commented 6 years ago

I don't know if that is the problem I have but it seems like it...

First some facts:

So, hostmanager handles my hosts files on the host and guests. However, it seems (I'm no expert in this) that my machine needs a domain name to work. If I don't have a domain name and send mails using postfix, I get those minute long delays and the following error messages in the log:

Hosts configuration:

# /etc/hosts (excerpt)
192.168.123.11  pb-test

Error messages:

/var/log/syslog
Oct 23 14:09:49 pb-test sendmail[950]: [ID 702911 mail.crit] My unqualified host name (pb-test) unknown; sleeping for retry
Oct 23 14:10:49 pb-test sendmail[950]: [ID 702911 mail.alert] unable to qualify my own domain name (pb-test) -- using short name

So it seems I need a domain name. When I edit the hosts file manually:

# /etc/hosts (excerpt)
192.168.123.11  pb-test pb-test.mydomain.com

and send mails, they are sent instantly and no error messages appear.

Now the problem with the hostmanager: The definable aliases are only added as separate lines:

# /etc/hosts (excerpt)
192.168.123.11  pb-test
192.168.123.11  pb-test.mydomain.com

This way the errors reappear.

So, this is probably the same feature request?

danowar2k commented 6 years ago

Addendum:

This will require a decent amount of architecting.

Okay, where could one discuss this? Inside the ticket? I could probably contribute a pull request, but I wouldn't want that PR to be useless...

How about doing it in small steps: