{"id":5560,"date":"2018-10-31T06:37:32","date_gmt":"2018-10-31T06:37:32","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=5560"},"modified":"2021-11-17T09:38:50","modified_gmt":"2021-11-17T09:38:50","slug":"ansible-execution-connection-type","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/ansible-execution-connection-type\/","title":{"rendered":"Ansible execution connection type"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5583\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/10\/Ansible-execution-copy.jpg\" alt=\"\" width=\"600\" height=\"315\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/10\/Ansible-execution-copy.jpg 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2018\/10\/Ansible-execution-copy-300x158.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>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=&lt;connector&gt;, the connection type can be changed.<\/p>\n<p><strong>SSH Based (Linux Based)<\/strong><br>\nThe default SSH protocol types is smart. This can be the name of any of ansible\u2019s connection plugins. SSH protocol types are..<\/p>\n<ol>\n<li>smart<\/li>\n<li>ssh<\/li>\n<li>paramiko<\/li>\n<\/ol>\n<p><strong>Non-SSH Based (Linux Based)<\/strong><\/p>\n<ol>\n<li>local &#8211; This connector can be used to deploy the playbook to the control machine itself.<\/li>\n<li>docker &#8211; This connector deploys the playbook directly into Docker containers using the local Docker client.<\/li>\n<\/ol>\n<p><strong>WinRM Based (Windows Based)<\/strong><br>\nUnlike Linux\/Unix hosts, which use SSH by default, Windows hosts are configured with WinRM.<\/p>\n<p>The authentication type may be set on inventory hosts or groups with the ansible_winrm_transport variable. ansible_winrm_transport may include<\/p>\n<ol>\n<li>Basic<\/li>\n<li>Certificate<\/li>\n<li>Kerberos<\/li>\n<li>NTLM<\/li>\n<li>CredSSP<\/li>\n<\/ol>\n<p><strong>Example<\/strong><\/p>\n<p>[targets]<\/p>\n<p>localhost ansible_connection=local<br>\nother1.example.com ansible_connection=ssh ansible_user=mpdehaan<\/p>\n<p><strong>Reference<\/strong><\/p>\n<ul>\n<li>https:\/\/docs.ansible.com\/ansible\/2.6\/user_guide\/windows_winrm.html<\/li>\n<\/ul>\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_64345\"><iframe loading=\"lazy\"  id=\"_ytid_52323\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_64345\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>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=&lt;connector&gt;, the connection type can be changed. SSH&#8230; <\/p>\n","protected":false},"author":1,"featured_media":5583,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5038],"tags":[639,5121,5120,600,5119,498,2790,5068],"class_list":["post-5560","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ansible","tag-ansible","tag-ansible_connection","tag-ansible_winrm_transport","tag-connection","tag-execution","tag-local","tag-smart","tag-type"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=5560"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5560\/revisions"}],"predecessor-version":[{"id":25565,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/5560\/revisions\/25565"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/5583"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=5560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=5560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=5560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}