Can i have a separate port for specific hosts for ansible to connect through?

We have one server that uses different port for ssh than others.
I’m using aws_ec2 for inventory management, can i somehow define there a separate port for this specific host ?

You can probably create a specific host_vars file at hosts_vars/hostname.yml, and then set ansible_port as needed (see here).

5 Likes

Thank you!
just needed hostname.yaml and inside it one line of ansible_port: xxxx and it works now :partying_face: