Note: This is going to be a very high level overview of connection plugins of Ansible.
Now that you know what Ansible does in it’s essence, the applications of Ansible are limitless, really. Taking on at a web server cluster was just an example, but you can do a lot more than that.
This is more like the design stage where you will be sipping coffee with your colleagues and white-boarding as on what you need to do on the servers running on a specific operating system. You might be doing the brainstorming as in what things are to be done first, if that goes all south, then what, how to recover from failures and stuff.
While you can define all tasks to be done in ansible scripts, or as we call them playbooks, you might need to work on your infrastructure.
Before you continue reading, I am promoting you to be the Senior Infrastructure Architect, Steve, who is kind of a boss man around. One who designs everything and gives out tasks and manages a team of people who actually writes the playbooks. You are kind of the Captain America to my Avengers. 🙂

So Cap’n, while you know the tasks that are to be automated, there might still be some implementation details that you need to define while having that first sip of coffee and you might say to your avengers as:
“ We need to automate and do these tasks on the servers in our infrastructure.
but the problem is.. we have a heterogeneous environment, where servers are ranging all the way from Red Hat Enterprise Linux, some of them are Microsoft Windows, a couple of docker containers and a handful of network devices. and all have different ways to connect, authenticate and login in themselves.”
While this is more or less a story, this is the hard reality.
Ansible can do things for you, but it needs to know the lower level details like how to connect to different types of systems and what protocols to use to log to devices, be it a Linux system, a windows server, a docker container, OpenShift Container Platform or the whole range of network devices.
This is where the Ansible connection plugins comes into the picture. They let you define how and what protocols would you be using to connect or authenticate to different type of devices.
There are a lot of them, but the most used connection plugins are:
SSH: This is the one ansible defaults to. It uses the same underlying Secure SHell implementations for logging in into the remote systems if they are Linux based, carry out the tasks on them and makes sure that the systems are in that desired state as you want them to be. On the remote system, sshd has to be running.
It uses the same keys and password for authentications. If for some security reasons, you are running ssh daemon on a non standard port, ansible can also connect on that port on the remote system using this connection plugins. You can tell ansible what users to use to login, their keys or passwords and ansible will login using those given information automatically.

WinRM: Windows Remote Management protocol can be used by ansible to login to a admin or non admin user in ansible and carry out tasks with those users on the logged in servers. It is a SOAP-based protocol that does communicate over HTTP/HTTPS, and is now available in all windows servers since Windows Server 12. However, to work with the same, you need to install the pywinrm package on your control node. that can be done using pip install “pywinrm>=0.3.0”

Docker: You can use ansible to manage your linux based docker containers, but the catch is, docker containers may not and should not have an ssh server running, which just increases the attack vector on your containers. With the docker connection type, you can use the same playbooks on the systems but ansible will be smart enough to know how to connect to the containers without ssh, and run commands inside the containers.

While there are a lot of connection plugins with ansible, this has been a very high level overview of what mostly used plugins ansible can use to connect to your devices, authenticate and login and carry out tasks on those systems, while you watch Avengers Endgame, and cherish the time and the memories when you were young..!!! 😉