The workaround I've been using is to create a separate DNS (or
/etc/hosts) entry for the tunnels. From my understanding since I
implemented it there has been some work done with host aliases/labels,
but I haven't had enough time to explore those.
With the DNS approach make sure that the *first* entry in your ansible
hosts file has the port number set correctly. The port number of all
following entries will be ignored. So for example you can have a
hosts file like this:
tunnel021.local:62021
tunnel022.local:62022
[foo]
tunnel021.local
tunnel022.local
The entries in group foo will use the previously defined ports for
those hosts.
With the DNS approach make sure that the first entry in your ansible
hosts file has the port number set correctly. The port number of all
following entries will be ignored.
Then, if I understand the above well, my use case does require keeping an up-to-date /etc/hosts because ansible will ignore specifying different ports for the same IP (127.0.0.1) in the inventory file?
From my understanding since I
implemented it there has been some work done with host aliases/labels,
Anybody has used a different approach with success?
but the connection code doesn't allow keeping a host specific address separate from the name in inventory right now. Patches would be considered for 0.7