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..
- smart
- ssh
- paramiko
Non-SSH Based (Linux Based)
- local – This connector can be used to deploy the playbook to the control machine itself.
- 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
- Basic
- Certificate
- Kerberos
- NTLM
- 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
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND