0

I'm running ec2 debian instance and trying to get puppet working on it. I'd like my hostnames to be something more readable, so I've changed /etc/hostname, run /etc/init.d/hostname.sh start and I can see my human-readable hostname in the prompt. Every other app seems to be working fine with it, but not puppet (and actually it seems it's facter problem):

$ cat /etc/hostname 
service.XXX.com
$ hostname
service.XXX.com
$ facter | egrep '(host|domain)'
domain => compute-1.amazonaws.com
hostname => ec2-107-22-XXX-XXX
$ cat /etc/debian_version 
6.0.1

I've already cheched facter code and it seems it does not anything more than parsing hostname output. Where is this thing come from? I want my hostnames!

rvs
  • 4,125
  • 1
  • 27
  • 31
  • Had the same hostname issue and adding it as first alias in hosts fixed the problem for me too. Debian Squeeze. –  Mar 06 '12 at 11:07

1 Answers1

0

Blah, it seems it parses /etc/hosts and my beautiful hostname should be the first alias for '127.0.0.1' (127.0.0.1 service.XXX.com localhost localhost.localdomain ...). Anyone knows, is this expected behavior?

I'm still not sure where ec2-blah-blah-blah comes from, but it seems the issue is resolved.

rvs
  • 4,125
  • 1
  • 27
  • 31
  • Puppet tries to get the reverse to the IP address -- I'm surprised `127.0.0.1` did it for you. It also looks up `/etc/resolv.conf` for the domain. Have you tried just grepping `ec2-...` on `/etc` to see what configuration contains that? – Daniel C. Sobral Nov 16 '11 at 11:54