My issue is: the public keys are stored in files that reference the hostnames, e.g. /mnt/c/Users/Recopy9779/.ssh/pubkeys/home.server.internal.pub for home.server.internal , but {{ inventory_hostname }} resolves to the IP (192.168.1.2).
All documentation I have read seems like {{ inventory_hostname }} should resolve to home.server.internal in this case.
What am I doing wrong here? Is there a way to access home.server.internal in a variable?
As you can see, value for IdentityFile SSH option is resolved properly. {{ inventory_hostname }} does resolve to a name, not to an IP address. ansible_host is holding the IP address.
Something else you are not showing here has led you to the wrong conclusion.
Somehow restarting WSL fixed it and I am unable to reproduce it now
Thanks
With regard to delegation , I have no idea what that is but I am just trying to get into the Ansible stuff
If you give SSH IdentitiesOnly and a public key, it will request that and only that key from the agent. This is super helpfull if you have one key per host, like I do and don’t want to trip MaxAuthTries