{"id":100,"date":"2019-07-01T12:06:44","date_gmt":"2019-07-01T04:06:44","guid":{"rendered":"http:\/\/mayanknauni.com\/?p=100"},"modified":"2019-07-01T13:04:16","modified_gmt":"2019-07-01T05:04:16","slug":"network-automation-with-ansible-playbook","status":"publish","type":"post","link":"https:\/\/mayanknauni.com\/?p=100","title":{"rendered":"Network Automation with Ansible \u2013 Playbook"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Use of Ansible Playbook for fetching information from network devices for troubleshooting purpose<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Playbooks for Fetching Output:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can use playbooks as well to fetch the information from the remote devices. The difference between Ad-hoc commands and playbook is that with Ad-Hoc we can pass a single ios command, where as a playbook can have multiple IOS commands. The playbook will perform all the commands on each device one by one.<\/p>\n\n\n\n<ul class=\"wp-block-gallery alignwide columns-3 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1823\" height=\"1051\" src=\"https:\/\/i1.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-ARP-2.png?fit=604%2C348&amp;ssl=1\" alt=\"\" data-id=\"105\" data-link=\"https:\/\/mayanknauni.com\/?attachment_id=105\" class=\"wp-image-105\" srcset=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-ARP-2.png?w=1823&amp;ssl=1 1823w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-ARP-2.png?resize=300%2C173&amp;ssl=1 300w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-ARP-2.png?resize=768%2C443&amp;ssl=1 768w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-ARP-2.png?resize=1024%2C590&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption><strong>Get ARP<\/strong><\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1766\" height=\"937\" src=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-MAC.png?fit=604%2C320&amp;ssl=1\" alt=\"\" data-id=\"106\" data-link=\"https:\/\/mayanknauni.com\/?attachment_id=106\" class=\"wp-image-106\" srcset=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-MAC.png?w=1766&amp;ssl=1 1766w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-MAC.png?resize=300%2C159&amp;ssl=1 300w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-MAC.png?resize=768%2C407&amp;ssl=1 768w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Get-MAC.png?resize=1024%2C543&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption><strong>Get MAC<\/strong><\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1823\" height=\"1081\" src=\"https:\/\/i1.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Multiple-ISO-Command.png?fit=604%2C358&amp;ssl=1\" alt=\"\" data-id=\"107\" data-link=\"https:\/\/mayanknauni.com\/?attachment_id=107\" class=\"wp-image-107\" srcset=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Multiple-ISO-Command.png?w=1823&amp;ssl=1 1823w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Multiple-ISO-Command.png?resize=300%2C178&amp;ssl=1 300w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Multiple-ISO-Command.png?resize=768%2C455&amp;ssl=1 768w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Multiple-ISO-Command.png?resize=1024%2C607&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption><strong>Running Multiple ISO Commands<\/strong><\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1832\" height=\"753\" src=\"https:\/\/i2.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Saving-Output-to-a-File.png?fit=604%2C248&amp;ssl=1\" alt=\"\" data-id=\"108\" data-link=\"https:\/\/mayanknauni.com\/?attachment_id=108\" class=\"wp-image-108\" srcset=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Saving-Output-to-a-File.png?w=1832&amp;ssl=1 1832w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Saving-Output-to-a-File.png?resize=300%2C123&amp;ssl=1 300w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Saving-Output-to-a-File.png?resize=768%2C316&amp;ssl=1 768w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Saving-Output-to-a-File.png?resize=1024%2C421&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption><strong>Saving Output to a File<\/strong><\/figcaption><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1830\" height=\"787\" src=\"https:\/\/i1.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Save-Running-Configuration-to-a-File.png?fit=604%2C260&amp;ssl=1\" alt=\"\" data-id=\"109\" data-link=\"https:\/\/mayanknauni.com\/?attachment_id=109\" class=\"wp-image-109\" srcset=\"https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Save-Running-Configuration-to-a-File.png?w=1830&amp;ssl=1 1830w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Save-Running-Configuration-to-a-File.png?resize=300%2C129&amp;ssl=1 300w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Save-Running-Configuration-to-a-File.png?resize=768%2C330&amp;ssl=1 768w, https:\/\/i0.wp.com\/mayanknauni.com\/wp-content\/uploads\/2019\/07\/Save-Running-Configuration-to-a-File.png?resize=1024%2C440&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><figcaption><strong>Get Running Configuration and Save it to a File<\/strong><\/figcaption><\/figure><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Use of Ansible Playbook for fetching information from network devices for troubleshooting purpose Playbooks for Fetching Output: We can use playbooks as well to fetch the information from the remote devices. The difference between Ad-hoc commands and playbook is that&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-netdevops"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":5,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":113,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions\/113"}],"wp:attachment":[{"href":"https:\/\/mayanknauni.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mayanknauni.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}