Hi,
I'm currently setting up two VMs that are accessible behind a single domain name but on different ports. I cannot figure
out how to specifiy host-vars seperately for each host. My aim is to allow ansible to SSH into each of these machines; I'm not currently
using hostvars for anything else.
However, there is no analogue for different hosts with the same domain name:
I cannot specify the domain-names alongside their ports
as Ansible passes the entire host to OpenSSH without using the -p argument, which means the host never resolves. It seems
to run code equivalent to the following
ssh foo@example-0.com:9001 # BAD
not
ssh foo@example-0.com -p 9001 # GOOD
Do you have any advice for how I can create a dynamic inventory that allows SSH access to machines with the same domain name
but different ports? I'll post more information if needed.
Thanks