Answers for "ansible ssh on different port"

0

ansible ssh on different port

#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
Posted by: Guest on October-22-2021
0

ansible ssh on different port

# 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"
}
Posted by: Guest on October-22-2021
0

ansible ssh on different port

[linux-servers]
xcpng5.homelab.com ansible_port=3511
xcpng2.homelab.com ansible_port=3522
xcpng1.homelab.com ansible_port=3523
Posted by: Guest on October-22-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language