vagrant-hostmanager icon indicating copy to clipboard operation
vagrant-hostmanager copied to clipboard

Please add aliases_on_separate_lines again

Open kupferk opened this issue 9 years ago • 4 comments
trafficstars

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.

kupferk avatar Nov 27 '15 11:11 kupferk

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.

ChinnoDog avatar Dec 15 '15 21:12 ChinnoDog

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.

seth-reeser avatar Feb 11 '16 19:02 seth-reeser

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

First some facts:

  • Hypervisor: VirtualBox
  • Vagrant box: https://app.vagrantup.com/heavybeans/boxes/solaris11-minimal-server
  • OS: Solaris 11.3
  • sendmail: disabled
  • postfix: OpenCSW package

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 avatar Oct 23 '18 13:10 danowar2k

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:

  • Bring back the switch aliases_on_separate_lines. Warn inside the documentation that the behaviour when set to "false" is not bug free. Default the switch to true.
  • Implementation of appropriate behaviour for many aliases (9+ it seems)
    • Option 1: Just count the given aliases and start a new line when there are more than X
    • Option 2: Let the user decide how many aliases should be in a line (configuration option)
    • Option 3: Differentiate between primary alias line and secondary alias lines. The primary aliases are on the same line as the hostname, secondary aliases are processed like Option 1, optionally combined with option 2.

danowar2k avatar Oct 23 '18 13:10 danowar2k