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

setting the hostname #1

Open
sdarwin opened this issue Jun 16, 2016 · 2 comments
Open

setting the hostname #1

sdarwin opened this issue Jun 16, 2016 · 2 comments

Comments

@sdarwin
Copy link

sdarwin commented Jun 16, 2016

Let's say you have a server whose shortname is oak, and fully qualified name is oak.trees.com, as in this forum thread: http://ubuntuforums.org/showthread.php?t=1984993

The file /etc/hostname should be:
oak

The file /etc/hosts should be:
127.0.0.1 localhost
127.0.1.1 oak.trees.com oak

The command:
hostname -f
would show:
oak.trees.com

The command:
hostname
would show:
oak

On the other hand, what appears to be happening with this playbook:

  • The command hostname incorrectly results in:
    oak.trees.com
  • In file /etc/hosts , 127.0.0.1 is being modified instead of 127.0.1.1
  • it is not computing the shortname correctly, which would be to remove everything after the first dot, so that a.b.c.d.e would become just a.
@sourcejedi
Copy link
Contributor

i.e. regarding the shortname,

hostname_hostname.split('.')[:-1]|join('.')

should be

hostname_hostname.split('.')[0]

in both README and defaults/main.yml

@boldandbusted
Copy link

This seems like a pretty critical flaw. Is this problem still present?

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

3 participants