Ansible SSH an einem anderen Port
[linux-servers]
xcpng5.homelab.com ansible_port=3511
xcpng2.homelab.com ansible_port=3522
xcpng1.homelab.com ansible_port=3523
DreamCoder
[linux-servers]
xcpng5.homelab.com ansible_port=3511
xcpng2.homelab.com ansible_port=3522
xcpng1.homelab.com ansible_port=3523
#The only thing I can think of that might work would be to create ssh aliases for your hosts. In your .ssh/config:
Host de.1.before
HostName 192.26.32.32
Port 22
Host de.1.after
HostName 192.26.32.32
Port 8888
#Then use these aliases in your Ansible inventory:
[de-servers-before]
de.1.before
[de-servers-after]
de.1.after
# Easy way, edit /etc/ansible/hosts:
[my_server]
ssdnodes:54321
and you can test it by issuing a ping:
ansible ssdnodes -m ping
#and the response would be:
ssdnodes | SUCCESS => {
"changed": false,
"ping": "pong"
}