Ansible execution connection type

Ansible executes playbooks in the remote server using following connection type. To change the connection type, you need to pass host-specific parameter ansible_connection=<connector>, the connection type can be changed.

SSH Based (Linux Based)
The default SSH protocol types is smart. This can be the name of any of ansible’s connection plugins. SSH protocol types are..

  1. smart
  2. ssh
  3. paramiko

Non-SSH Based (Linux Based)

  1. local – This connector can be used to deploy the playbook to the control machine itself.
  2. docker – This connector deploys the playbook directly into Docker containers using the local Docker client.

WinRM Based (Windows Based)
Unlike Linux/Unix hosts, which use SSH by default, Windows hosts are configured with WinRM.

The authentication type may be set on inventory hosts or groups with the ansible_winrm_transport variable. ansible_winrm_transport may include

  1. Basic
  2. Certificate
  3. Kerberos
  4. NTLM
  5. CredSSP

Example

[targets]

localhost ansible_connection=local
other1.example.com ansible_connection=ssh ansible_user=mpdehaan

Reference

  • https://docs.ansible.com/ansible/2.6/user_guide/windows_winrm.html