In my inventory I define hosts like this:
[server1]
141.151.176.223
I am looking for a variable which keeps the server1
name, as I am using it to define server hostname.
inventory_hostname
is set to 141.151.176.223
ansible_hostname
as well as inventory_hostname_short
is set to 148
.
To workaround this problem I am setting my own variable like this:
[server1]
141.151.176.223 hostname=server1
but I am not satisfied with this approach.
Any ideas?