Knife output displays incorrect name


#1

Greetings,

I have a few servers that are not displaying their hostnames properly in the knife output. Its not affecting anything, but I can’t figure out why. The hostname has been configured correctly on the server and it has public/private DNS entries in AWS. It looks like it only is affecting servers with public IPs in AWS and only when using a glob.

In the knife output, the name is ec2-1-2-3-4.us-west-2.compute.amazonaws.com instead of the actual node name.

[centos@bastion chef-repo]$ knife ssh 'name:bastion.example.com' 'hostname -f'
ec2-1-2-3-4.us-west-2.compute.amazonaws.com bastion.example.com

[centos@bastion chef-repo]$ knife ssh -m bastion.example.com 'hostname -f'
bastion.example.com bastion.example.com

[centos@bastion chef-repo]$ knife node show bastion.example.com -a fqdn
bastion.example.com:
  fqdn: bastion.example.com

[centos@bastion chef-repo]$ knife node show bastion.example.com -a name
bastion.example.com:
  name: bastion.example.com

[centos@bastion chef-repo]$ knife node show bastion.example.com -a hostname
bastion.example.com:
  hostname: bastion