Ansible closed issue | Can not list multiple hosts have different ports on a same hostname

I put hostname setting to my ssh config and solve it.

~/.ssh/config

Host dockerhost1
HostName localhost
Port 2221

Host dockerhost2
HostName localhost
Port 2222

Host dockerhost3
HostName localhost
Port 2223

Fixed inventory file

[group1]
dockerhost1

[group2]
dockerhost2

--

--