The controller hostname recorded by ara for the controller can be something like 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa (on OS X?)
dmsimard opened this issue · comments
What is the issue ?
Using ara under Mac OS X, the hostname that python picks up on my machine is 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa
which isn't particularly useful when the hostname
and hostname -f
commands both return a proper hostname like laptop.example.org
.
We rely on python's socket.getfqdn() and socket.gethostname() to retrieve the hostname:
ara/ara/plugins/callback/ara_default.py
Lines 829 to 833 in 196e256
On OS X (at least on my machine, I'm an OS X noob), getfqdn
returns the ipv6 arpa mentioned previously and gethostname
returns the actual hostname.
What should be happening ?
There's settings that determine which format is used:
In this particular case, hostname
would probably be a better default than fqdn
. Is this generally true for all distros ?
Changing it could result in playbooks being associated to a "new" controller if the fqdn and hostname are not the same.
Happy to hear what you think.
In this particular case, hostname would probably be a better default than fqdn. Is this generally true for all distros ?
on Debian 11 here:
socket.getfqdn() -> laptop.example.org
socket.gethostname() -> laptop
I prefer getfqdn much more since gethostname could not be unique.