Open jmpolom opened 2 years ago
host.name
should achieve this for you @jmpolom! Will keep this open as a docs issue 👍
I also think it would be great to have this in documentation :)
And me.
What about if one wants to know the IP of the target host, even if it's specified in the inventory as host name?
My use case is that my inventory uses the names from .ssh/config file, and I would like to get the IP to do some stuff (like setting and internal dnsmasq DNS server to point to the containerized web services in it).
If I get the Ipv4Addrs fact, I get the IPs of all the virtual networks (docker, kvm) along with the physical interface, so it's hard to extract something useful without prior knowledge of the name of the ethernet interface name.
Example inventory:
How can I obtain, from within a pyinfra deploy, the value of the current inventory item the deploy is running on? This is not clear from the documentation.
host.hostname
seems to gather a fact but I'm not looking to query the host for anything -- just find out the current connection as described in the inventory.