Non-standard Ansible Port
Red Hat Ansible
If you plan on starting with Ansible
any time soon, one thing you can really appreciate is that prior to having a smooth post-configuration process you’re going to configure a number of pre-existing servers, all from different periods and possibly running different operating systems. Some might even use different SSH port.
Ansible uses SSH
As you know, Ansible uses standard SSH port for connecting to Unix/Linux servers remotely. Default SSH port is 22, but it’s possible to configure SSH to use some other port – and this becomes a problem because Ansible can’t connect to such hosts.
Specify non-standard SSH port in Ansible
It’s fairly easy to make Ansible recognise that some server needs to be accessed using a different port. Simply expand your Ansible hosts entry from something like this (you’re going to have different hostname and IP address, most likely):
To this:
That’s all there is to it! Enjoy!
See Also
- Ansible Software
- Ansible Reference
- Docker module in Ansible
- Dry-running Ansible scripts
- Getting started with Ansible
- Ansible module for Docker
- Run Ansible tasks for specific OS release version
- Create backup files when deploying with Ansible
Red Hat Ansible
If you plan on starting with Ansible
any time soon, one thing you can really appreciate is that prior to having a smooth post-configuration process you’re going to configure a number of pre-existing servers, all from different periods and possibly running different operating systems. Some might even use different SSH port.
Ansible uses SSH
As you know, Ansible uses standard SSH port for connecting to Unix/Linux servers remotely. Default SSH port is 22, but it’s possible to configure SSH to use some other port – and this becomes a problem because Ansible can’t connect to such hosts.
Specify non-standard SSH port in Ansible
It’s fairly easy to make Ansible recognise that some server needs to be accessed using a different port. Simply expand your Ansible hosts entry from something like this (you’re going to have different hostname and IP address, most likely):
To this:
That’s all there is to it! Enjoy!
See Also
- Ansible Software
- Ansible Reference
- Docker module in Ansible
- Dry-running Ansible scripts
- Getting started with Ansible
- Ansible module for Docker
- Run Ansible tasks for specific OS release version
- Create backup files when deploying with Ansible