CINXE.COM

How to Use Ansible with CML - Cisco Blogs

<!doctype html> <html lang="en-US" class="no-touch js "> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!--<link rel="profile" href="https://gmpg.org/xfn/11"> --> <meta name="blogsPostDate" content="2024-01-17 12:00:05"/><meta name="blogsPostTags" content="ansible,cisco-modeling-labs,devops"/><meta name="blogsPostCat" content="Learning"/><meta name="article:category" content="Learning"/><meta name=priorityNarrativeList" content="None"/> <meta name="wordCount" content="1583" /> <meta name="readTime" content="379" /> <!-- loading cdc-template web component scripts --> <script type='text/javascript' src="//www.cisco.com/etc/designs/cdc/clientlibs/responsive/js/web-component-foundation.min.js"></script> <script> /** * Invokes appropriate private methods based on input parameters based on needs of web component architecture * @param {Array} wcAssets array of strings that correlate to the names of web components or array of objects containing asset name and corresponding locale/path * @param {String} localePath specifies where web component should be retrieved from (expected format: en/us or en_au for all other locales); false if wcAssets, is array of objects * @param {Boolean} isWem [Optional] specifies if assets are being loaded on a WEM environment * @param {Boolean} needTargetter [Optional] specifies need for targetter bundle to be loaded (generally needed on external sites) * @param {Boolean} isRelative [Optional] specifies if asset path(s) should be relative * @param {String} env [Optional] specifies enviornment to append to relative path (should not be used with isRelative) * @param {Boolean} hasEnvOverride [Optional] specifies if environment needs to be overridden (should be used with env) */ cdc.wcAncillaryAssetAllocator.init(['cdc-template-blogs'], 'en/us', false, true, false, 'prod'); if (window.cdc === undefined) { window.cdc = {}; } if (cdc.cdcMasthead === undefined) { cdc.cdcMasthead = {}; } if (cdc.cdcMasthead.additional === undefined) { cdc.cdcMasthead.additional = {}; } cdc.cdcMasthead.additional.env = 'prod'; </script> <script type="text/javascript"> if ( typeof cdc === "undefined")cdc = {}; if ( typeof cdc.util === "undefined")cdc.util = {}; cdc.util.ensureNamespace = function (namespaceStr) { if (!namespaceStr) { return; var parts = namespaceStr.split("."); var o = window; var i; var aPart; for (i = 0; i < parts.length; i++) aPart = parts[i]; if (typeof (o[aPart]) != "object"){ o[aPart] = {}; } o = o[aPart]; } }; cdc.dm = {}; cdc.dm.util = {}; cdc.dm.util.ensureNamespace = cdc.util.ensureNamespace; </script> <meta name="author" content="Steven Carter" /><meta name="blogsPostAuthor" content="Steven Carter" /><meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' /> <script type="text/javascript" src="//www.cisco.com/c/dam/cdc/t/ctm-core.js"></script> <!-- This site is optimized with the Yoast SEO Premium plugin v19.3 (Yoast SEO v19.11) - https://yoast.com/wordpress/plugins/seo/ --> <title>How to Use Ansible with CML - Cisco Blogs</title> <meta name="description" content="Ansible can be used with CML (Cisco Modeling Labs) to automate the deployment and management of network infrastructure, offering reproducibility, consistency, and automation in network infrastructure management." /> <link rel="canonical" href="https://blogs.cisco.com/learning/how-to-use-ansible-with-cml" /> <meta property="og:locale" content="en_US" /> <meta property="og:type" content="article" /> <meta property="og:title" content="How to Use Ansible with CML" /> <meta property="og:description" content="Ansible can be used with CML (Cisco Modeling Labs) to automate the deployment and management of network infrastructure, offering reproducibility, consistency, and automation in network infrastructure management." /> <meta property="og:url" content="https://blogs.cisco.com/learning/how-to-use-ansible-with-cml" /> <meta property="og:site_name" content="Cisco Blogs" /> <meta property="article:published_time" content="2024-01-17T20:00:05+00:00" /> <meta property="article:modified_time" content="2024-11-15T15:13:23+00:00" /> <meta property="og:image" content="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/AdobeStock_643489735.jpg" /> <meta property="og:image:width" content="1300" /> <meta property="og:image:height" content="731" /> <meta property="og:image:type" content="image/jpeg" /> <meta name="author" content="Steven Carter" /> <meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:label1" content="Written by" /> <meta name="twitter:data1" content="Steven Carter" /> <meta name="twitter:label2" content="Est. reading time" /> <meta name="twitter:data2" content="8 minutes" /> <script type="application/ld+json" class="yoast-schema-graph">{"@context":"https://schema.org","@graph":[{"@type":"Article","@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#article","isPartOf":{"@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml"},"author":{"name":"Steven Carter","@id":"https://blogs.cisco.com/#/schema/person/c5093918d63bd7cc6be6986521403350"},"headline":"How to Use Ansible with CML","datePublished":"2024-01-17T20:00:05+00:00","dateModified":"2024-11-15T15:13:23+00:00","mainEntityOfPage":{"@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml"},"wordCount":1446,"publisher":{"@id":"https://blogs.cisco.com/#organization"},"image":{"@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#primaryimage"},"thumbnailUrl":"https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/AdobeStock_643489735.jpg","keywords":["Ansible","Cisco Modeling Labs","devops"],"articleSection":["Learning"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml","url":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml","name":"How to Use Ansible with CML - Cisco Blogs","isPartOf":{"@id":"https://blogs.cisco.com/#website"},"primaryImageOfPage":{"@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#primaryimage"},"image":{"@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#primaryimage"},"thumbnailUrl":"https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/AdobeStock_643489735.jpg","datePublished":"2024-01-17T20:00:05+00:00","dateModified":"2024-11-15T15:13:23+00:00","description":"Ansible can be used with CML (Cisco Modeling Labs) to automate the deployment and management of network infrastructure, offering reproducibility, consistency, and automation in network infrastructure management.","breadcrumb":{"@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https://blogs.cisco.com/learning/how-to-use-ansible-with-cml"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#primaryimage","url":"https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/AdobeStock_643489735.jpg","contentUrl":"https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/AdobeStock_643489735.jpg","width":1300,"height":731},{"@type":"BreadcrumbList","@id":"https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Cisco Blogs","item":"https://blogs.cisco.com/"},{"@type":"ListItem","position":2,"name":"Learning","item":"https://blogs.cisco.com/learning"},{"@type":"ListItem","position":3,"name":"How to Use Ansible with CML"}]},{"@type":"WebSite","@id":"https://blogs.cisco.com/#website","url":"https://blogs.cisco.com/","name":"Cisco Blogs","description":"","publisher":{"@id":"https://blogs.cisco.com/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://blogs.cisco.com/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https://blogs.cisco.com/#organization","name":"Cisco Systems","url":"https://blogs.cisco.com/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https://blogs.cisco.com/#/schema/logo/image/","url":"https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2020/10/Cisco_Logo_no_TM_Sky_Blue-RGB.png","contentUrl":"https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2020/10/Cisco_Logo_no_TM_Sky_Blue-RGB.png","width":912,"height":482,"caption":"Cisco Systems"},"image":{"@id":"https://blogs.cisco.com/#/schema/logo/image/"}},{"@type":"Person","@id":"https://blogs.cisco.com/#/schema/person/c5093918d63bd7cc6be6986521403350","name":"Steven Carter","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https://blogs.cisco.com/#/schema/person/image/","url":"https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2022/07/1537493695-bpfull.jpg","contentUrl":"https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2022/07/1537493695-bpfull.jpg","caption":"Steven Carter"},"description":"Steven Carter has over 20 years of industry experience working in large universities, government research and development, and the private sector. He has spent time as a system administrator running some of the World’s largest supercomputers and a network engineer building out the World’s first SDN network for the Department of Energy. In addition, Steven has a wide range of experience in networking including operations, embedded software development, and sales. He has spent the last couple of years helping large customers automate their networks and build out NetDevOps workflows.","url":"https://blogs.cisco.com/author/stevencarter"}]}</script> <!-- / Yoast SEO Premium plugin. --> <link rel='dns-prefetch' href='//www.cisco.com' /> <link rel='dns-prefetch' href='//s.w.org' /> <link rel="alternate" type="application/rss+xml" title="Cisco Blogs &raquo; Feed" href="https://blogs.cisco.com/feed" /> <link rel="alternate" type="application/rss+xml" title="Cisco Blogs &raquo; Comments Feed" href="https://blogs.cisco.com/comments/feed" /> <link rel="alternate" type="application/rss+xml" title="Cisco Blogs &raquo; How to Use Ansible with CML Comments Feed" href="https://blogs.cisco.com/learning/how-to-use-ansible-with-cml/feed" /> <script type="text/javascript"> window._wpemojiSettings = {"baseUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.1.0\/72x72\/","ext":".png","svgUrl":"https:\/\/s.w.org\/images\/core\/emoji\/13.1.0\/svg\/","svgExt":".svg","source":{"concatemoji":"https:\/\/blogs.cisco.com\/wp-includes\/js\/wp-emoji-release.min.js?ver=5.9.2"}}; /*! This file is auto-generated */ !function(e,a,t){var n,r,o,i=a.createElement("canvas"),p=i.getContext&&i.getContext("2d");function s(e,t){var a=String.fromCharCode;p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,e),0,0);e=i.toDataURL();return p.clearRect(0,0,i.width,i.height),p.fillText(a.apply(this,t),0,0),e===i.toDataURL()}function c(e){var t=a.createElement("script");t.src=e,t.defer=t.type="text/javascript",a.getElementsByTagName("head")[0].appendChild(t)}for(o=Array("flag","emoji"),t.supports={everything:!0,everythingExceptFlag:!0},r=0;r<o.length;r++)t.supports[o[r]]=function(e){if(!p||!p.fillText)return!1;switch(p.textBaseline="top",p.font="600 32px Arial",e){case"flag":return s([127987,65039,8205,9895,65039],[127987,65039,8203,9895,65039])?!1:!s([55356,56826,55356,56819],[55356,56826,8203,55356,56819])&&!s([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]);case"emoji":return!s([10084,65039,8205,55357,56613],[10084,65039,8203,55357,56613])}return!1}(o[r]),t.supports.everything=t.supports.everything&&t.supports[o[r]],"flag"!==o[r]&&(t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&t.supports[o[r]]);t.supports.everythingExceptFlag=t.supports.everythingExceptFlag&&!t.supports.flag,t.DOMReady=!1,t.readyCallback=function(){t.DOMReady=!0},t.supports.everything||(n=function(){t.readyCallback()},a.addEventListener?(a.addEventListener("DOMContentLoaded",n,!1),e.addEventListener("load",n,!1)):(e.attachEvent("onload",n),a.attachEvent("onreadystatechange",function(){"complete"===a.readyState&&t.readyCallback()})),(n=t.source||{}).concatemoji?c(n.concatemoji):n.wpemoji&&n.twemoji&&(c(n.twemoji),c(n.wpemoji)))}(window,document,window._wpemojiSettings); </script> <style type="text/css"> img.wp-smiley, img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 0.07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; } </style> <link rel='stylesheet' id='wp-block-library-css' href='https://blogs.cisco.com/wp-includes/css/dist/block-library/style.min.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='wp-components-css' href='https://blogs.cisco.com/wp-includes/css/dist/components/style.min.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='wp-block-editor-css' href='https://blogs.cisco.com/wp-includes/css/dist/block-editor/style.min.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='wp-nux-css' href='https://blogs.cisco.com/wp-includes/css/dist/nux/style.min.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='wp-reusable-blocks-css' href='https://blogs.cisco.com/wp-includes/css/dist/reusable-blocks/style.min.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='wp-editor-css' href='https://blogs.cisco.com/wp-includes/css/dist/editor/style.min.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='mux_video_block_style-css' href='https://blogs.cisco.com/wp-content/plugins/ilab-media-tools/public/blocks/mediacloud-mux.blocks.style.css' type='text/css' media='all' /> <style id='global-styles-inline-css' type='text/css'> body{--wp--preset--color--black: #000;--wp--preset--color--cyan-bluish-gray: #abb8c3;--wp--preset--color--white: #ffffff;--wp--preset--color--pale-pink: #f78da7;--wp--preset--color--vivid-red: #cf2e2e;--wp--preset--color--luminous-vivid-orange: #ff6900;--wp--preset--color--luminous-vivid-amber: #fcb900;--wp--preset--color--light-green-cyan: #7bdcb5;--wp--preset--color--vivid-green-cyan: #00d084;--wp--preset--color--pale-cyan-blue: #8ed1fc;--wp--preset--color--vivid-cyan-blue: #0693e3;--wp--preset--color--vivid-purple: #9b51e0;--wp--preset--color--cisco-midnight-blue: #0d274d;--wp--preset--color--cisco-ocean-blue: #1e4471;--wp--preset--color--cisco-sky-blue: #00bceb;--wp--preset--color--cisco-green: #6abf4b;--wp--preset--color--cisco-orange: #fbab18;--wp--preset--color--cisco-red: #e2231a;--wp--preset--color--dark-gray: #495057;--wp--preset--color--medium-gray: #9e9ea2;--wp--preset--color--light-gray: #ced4da;--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple: linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%);--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan: linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%);--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange: linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%);--wp--preset--gradient--luminous-vivid-orange-to-vivid-red: linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%);--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray: linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%);--wp--preset--gradient--cool-to-warm-spectrum: linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%);--wp--preset--gradient--blush-light-purple: linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%);--wp--preset--gradient--blush-bordeaux: linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%);--wp--preset--gradient--luminous-dusk: linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%);--wp--preset--gradient--pale-ocean: linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%);--wp--preset--gradient--electric-grass: linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%);--wp--preset--gradient--midnight: linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%);--wp--preset--duotone--dark-grayscale: url('#wp-duotone-dark-grayscale');--wp--preset--duotone--grayscale: url('#wp-duotone-grayscale');--wp--preset--duotone--purple-yellow: url('#wp-duotone-purple-yellow');--wp--preset--duotone--blue-red: url('#wp-duotone-blue-red');--wp--preset--duotone--midnight: url('#wp-duotone-midnight');--wp--preset--duotone--magenta-yellow: url('#wp-duotone-magenta-yellow');--wp--preset--duotone--purple-green: url('#wp-duotone-purple-green');--wp--preset--duotone--blue-orange: url('#wp-duotone-blue-orange');--wp--preset--font-size--small: 13px;--wp--preset--font-size--medium: 20px;--wp--preset--font-size--large: 36px;--wp--preset--font-size--x-large: 42px;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-color{color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-color{color: var(--wp--preset--color--white) !important;}.has-pale-pink-color{color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-color{color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-color{color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-color{color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-color{color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-color{color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-color{color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-color{color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-color{color: var(--wp--preset--color--vivid-purple) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-background-color{background-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-pale-pink-background-color{background-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-background-color{background-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-background-color{background-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-background-color{background-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-background-color{background-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-background-color{background-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-background-color{background-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-background-color{background-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-background-color{background-color: var(--wp--preset--color--vivid-purple) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-border-color{border-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-pale-pink-border-color{border-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-border-color{border-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-border-color{border-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-border-color{border-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-border-color{border-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-border-color{border-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-border-color{border-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-border-color{border-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-border-color{border-color: var(--wp--preset--color--vivid-purple) !important;}.has-vivid-cyan-blue-to-vivid-purple-gradient-background{background: var(--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple) !important;}.has-light-green-cyan-to-vivid-green-cyan-gradient-background{background: var(--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan) !important;}.has-luminous-vivid-amber-to-luminous-vivid-orange-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange) !important;}.has-luminous-vivid-orange-to-vivid-red-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-orange-to-vivid-red) !important;}.has-very-light-gray-to-cyan-bluish-gray-gradient-background{background: var(--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray) !important;}.has-cool-to-warm-spectrum-gradient-background{background: var(--wp--preset--gradient--cool-to-warm-spectrum) !important;}.has-blush-light-purple-gradient-background{background: var(--wp--preset--gradient--blush-light-purple) !important;}.has-blush-bordeaux-gradient-background{background: var(--wp--preset--gradient--blush-bordeaux) !important;}.has-luminous-dusk-gradient-background{background: var(--wp--preset--gradient--luminous-dusk) !important;}.has-pale-ocean-gradient-background{background: var(--wp--preset--gradient--pale-ocean) !important;}.has-electric-grass-gradient-background{background: var(--wp--preset--gradient--electric-grass) !important;}.has-midnight-gradient-background{background: var(--wp--preset--gradient--midnight) !important;}.has-small-font-size{font-size: var(--wp--preset--font-size--small) !important;}.has-medium-font-size{font-size: var(--wp--preset--font-size--medium) !important;}.has-large-font-size{font-size: var(--wp--preset--font-size--large) !important;}.has-x-large-font-size{font-size: var(--wp--preset--font-size--x-large) !important;} </style> <link rel='stylesheet' id='category-css-css' href='https://blogs.cisco.com/wp-content/plugins/cisco-category-page-enhancement/css/category-css.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='multiauthor_custom_front_style-css' href='https://blogs.cisco.com/wp-content/plugins/cisco-multiple-authors/css/multiauthor.css?ver=1.1' type='text/css' media='all' /> <link rel='stylesheet' id='parent-style-css' href='https://blogs.cisco.com/wp-content/themes/ciscowordpress/style.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='child-style-css' href='https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/style.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='ciscowordpress-style-css' href='https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/style.css?ver=5.9.2' type='text/css' media='all' /> <style id='ciscowordpress-style-inline-css' type='text/css'> @media only screen and (min-width: 930px){ ul#featured_categories li{ width: calc(100%/ ); }} </style> <link rel='stylesheet' id='cui-standard-css' href='https://www.cisco.com/web/fw/cisco-ui/1.3.5/dist/css/cui-standard.min.css?ver=5.9.2' type='text/css' media='all' /> <link rel='stylesheet' id='style_login_widget-css' href='https://blogs.cisco.com/wp-content/plugins/miniorange-oauth-oidc-single-sign-on/resources/css/style_login_widget.css?ver=5.9.2' type='text/css' media='all' /> <script type='text/javascript' src='https://blogs.cisco.com/wp-content/plugins/cisco-multiple-authors/js/custom-multiauthor.js?ver=5.9.2' id='multiauthor_custom_js-js'></script> <script type='text/javascript' src='https://blogs.cisco.com/wp-content/themes/ciscowordpress/js/card-dropdown.js?ver=5.9.2' id='ciscowordpress-card-tag-dropdown-js'></script> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://blogs.cisco.com/xmlrpc.php?rsd" /> <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://blogs.cisco.com/wp-includes/wlwmanifest.xml" /> <meta name="generator" content="WordPress 5.9.2" /> <link rel='shortlink' href='https://blogs.cisco.com/?p=447900' /> <link rel="alternate" type="application/json+oembed" href="https://blogs.cisco.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fblogs.cisco.com%2Flearning%2Fhow-to-use-ansible-with-cml" /> <link rel="alternate" type="text/xml+oembed" href="https://blogs.cisco.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fblogs.cisco.com%2Flearning%2Fhow-to-use-ansible-with-cml&#038;format=xml" /> <link rel="icon" href="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/09/cropped-Cisco-logo-thumb-sky-blue-32x32.jpg" sizes="32x32" /> <link rel="icon" href="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/09/cropped-Cisco-logo-thumb-sky-blue-192x192.jpg" sizes="192x192" /> <link rel="apple-touch-icon" href="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/09/cropped-Cisco-logo-thumb-sky-blue-180x180.jpg" /> <meta name="msapplication-TileImage" content="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/09/cropped-Cisco-logo-thumb-sky-blue-270x270.jpg" /> </head> <body class="post-template-default single single-post postid-447900 single-format-standard no-sidebar"> <div id="page" class="site"> <cdc-template-micro lang="en" search-set-context="blogs"> <a class="skip-link screen-reader-text" href="#content">Skip to content</a> <header id="masthead" class="site-header"> </header><!-- #masthead --> <div id="content" class="site-content"> <div id="primary" class="content-area"> <main id="main" class="site-main"> <p id="breadcrumbs"><span><span><a href="https://blogs.cisco.com/">Cisco Blogs</a> / <span><a href="https://blogs.cisco.com/learning">Learning</a> / <span class="breadcrumb_last" aria-current="page">How to Use Ansible with CML</span></span></span></span></p> <div class="blog-post-header"> </div> <article id="post-447900" class="post-447900 post type-post status-publish format-standard has-post-thumbnail hentry category-learning tag-ansible tag-cisco-modeling-labs tag-devops"> <div class="main-content"> <header class="entry-header"> <div class="entry-meta"> January 17, 2024 <a id="post-comments" href="https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#comments">1 Comment</a> <hr> </div><!-- .entry-meta --> </header><!-- .entry-header --> <div class="blog-post-header"> <div class="thumbnail-avatar"> <div class="post-thumbnail" style="background-image:url(https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/AdobeStock_643489735-600x200.jpg);"> <img src="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2022/07/1537493695-bpfull.jpg" width="102" height="102" alt="Avatar" class="avatar avatar-102 wp-user-avatar wp-user-avatar-102 photo avatar-default"> </div> </div> <div class="blog-cat-post-author-container"> <a href=https://blogs.cisco.com/learning><h5>Learning</h5></a> <h1 class="entry-title">How to Use Ansible with CML</h1><p class="wordcount"><span class="black">6 min read</span></p> <p> <a href="https://blogs.cisco.com/author/stevencarter" title="Posts by Steven Carter" rel="author">Steven Carter</a> </p> </div> </div> <!-- .blog-post-header --> <div class="entry-content"> <p>How can Ansible help people building simulations with Cisco Modeling Labs (CML)?</p> <p><span data-contrast="auto">Similar to </span><a href="https://blogs.cisco.com/learning/get-started-with-terraform-and-cisco-modeling-labs"><span data-contrast="none">Terraform</span></a><span data-contrast="auto">, Ansible is a common, open-source automation tool often used in Continuous Integration/Continuous Deployment (CI/CD) DevOps methodologies. They are both a type of Infrastructure as Code (IaC) or Infrastructure as Data that allow you to render your infrastructure as text files and control it using tools such as Git. The advantage is reproducibility, consistency, speed, and the knowledge that, when you change the code, people approve, and it gets tested before it’s pushed out to your production network. This paradigm allows enterprises to run their network infrastructure in the same way they run their software and cloud practices. Afterall, the infrastructure is there to support the apps, so why manage them differently?</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">Although overlaps exist in the capabilities of Terraform and Ansible, they are very complementary. While Terraform is better at the initial deployment and ensuring ongoing consistency of the underlying infrastructure, Ansible is better at the initial configuration and ongoing management of the things that live in that infrastructure, such as systems, network devices, and so on.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">In a common workflow in which an operator wants to make a change to the network, let’s say adding a new network to be advertised via BGP, a network engineer would specify that change in the code or more likely as configuration data in YAML or JSON. In a typical CI workflow, that change would need to be approved by others for correctness or adherence to corporate and security concerns, for instance. In addition to the eyeball tests, a series of automated testing validates the data and then deploys the proposed change in a test network. Those tests can be run in a physical test network, a virtual test network, or a combination of the two. That flow might look like the following:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><img class="aligncenter wp-image-447904 size-large" src="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.33.10 PM-1024x497.png" alt="Workflow example" width="640" height="311" srcset="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.33.10 PM-1024x497.png 1024w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.33.10 PM-300x146.png 300w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.33.10 PM-768x373.png 768w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.33.10 PM.png 1400w" sizes="(max-width: 640px) 100vw, 640px" /></p> <p><span data-contrast="auto">The advantage of leveraging virtual test networks is profound. The cost is dramatically lower, and the ability to automate testing is increased significantly. For example, a network engineer can spin up and configure a new, complex topology multiple times without the likelihood of old tests messing up the accuracy of the current testing. Cisco Modeling Labs is a great tool for this type of test.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">Here’s where the Ansible CML Collection comes in. Similar to the CML Terraform integration covered in a </span><a href="https://blogs.cisco.com/learning/get-started-with-terraform-and-cisco-modeling-labs"><span data-contrast="none">previous blog</span></a><span data-contrast="auto">, the Ansible CML Collection can automate the deployment of topologies in CML for testing. The Ansible CML Collection has modules to create, start, and stop a topology and the hosts within it, but more importantly, it has a dynamic inventory plugin for getting information about the topology. This is important for automation because topologies can change. Or multiple topologies could exist, depending on the tests being performed. If your topology uses dynamic host configuration protocol (DHCP) and/or CML’s PATty functionality, the information for how Ansible communicates with the nodes needs to be communicated to the playbook.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">Let’s go over some of the features of the Ansible CML Collection’s dynamic inventory plugin.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">First, we need to install the collection:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <pre><span class="TextRun SCXW150720716 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW150720716 BCX0">ansible-galaxy collection </span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW150720716 BCX0">install</span> <span class="NormalTextRun SpellingErrorV2Themed SCXW150720716 BCX0">cisco.cml</span></span><span class="EOP SCXW150720716 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}">  </span></pre> <p><span class="TextRun SCXW168572771 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW168572771 BCX0">Next, we create a </span><span class="NormalTextRun SpellingErrorV2Themed SCXW168572771 BCX0">cml.yml</span><span class="NormalTextRun SCXW168572771 BCX0"> in the inventory with the following contents to tell Ansible to use the </span><span class="NormalTextRun SCXW168572771 BCX0">Ansible CML Collection’s dynamic inventory plugin:</span></span><span class="EOP SCXW168572771 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <pre><span data-contrast="auto">plugin: cisco.cml.cml_inventory</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">group_tags: network, ios, nxos, router </span></pre> <p><span class="TextRun SCXW84959672 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW84959672 BCX0">In addition </span><span class="NormalTextRun SCXW84959672 BCX0">to</span><span class="NormalTextRun SCXW84959672 BCX0"> specifying the plugin name, we can also define tags that</span><span class="NormalTextRun SCXW84959672 BCX0">,</span><span class="NormalTextRun SCXW84959672 BCX0"> when found on the devices in the topology, add that device to an Ansible group to be used later in the playbook</span><span class="NormalTextRun SCXW84959672 BCX0">:</span></span><span class="EOP SCXW84959672 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><img loading="lazy" class="aligncenter wp-image-447906 size-full" src="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.44.31 PM.png" alt="" width="826" height="318" srcset="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.44.31 PM.png 826w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.44.31 PM-300x115.png 300w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.44.31 PM-768x296.png 768w" sizes="(max-width: 826px) 100vw, 826px" /></p> <p><span class="TextRun SCXW84959672 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW84959672 BCX0">In addition </span><span class="NormalTextRun SCXW84959672 BCX0">to</span><span class="NormalTextRun SCXW84959672 BCX0"> specifying the plugin name, we can also define tags that</span><span class="NormalTextRun SCXW84959672 BCX0">,</span><span class="NormalTextRun SCXW84959672 BCX0"> when found on the devices in the topology, add that device to an Ansible group to be used later in the playbook</span><span class="NormalTextRun SCXW84959672 BCX0">:</span></span></p> <ul> <li><span style="font-family: Consolas, Monaco, monospace; color: #ff9900;" data-contrast="none">CML_USERNAME</span><span style="font-family: Consolas, Monaco, monospace;" data-contrast="auto"><span style="color: #ff9900;">:</span> Username for the CML user</span></li> <li><span style="color: #ff9900;">CML_PASSWORD</span><span style="font-family: Consolas, Monaco, monospace;" data-contrast="auto"><span style="color: #ff9900;">:</span> Password for the CML user</span></li> <li><span style="color: #ff9900;">CML_HOST</span><span style="font-family: Consolas, Monaco, monospace;" data-contrast="auto"><span style="color: #ff9900;">:</span> The CML host</span></li> <li><span style="color: #ff9900;">CML_LAB</span><span style="font-family: Consolas, Monaco, monospace;" data-contrast="auto"><span style="color: #ff9900;">:</span> The name of the lab</span><span style="font-family: Consolas, Monaco, monospace;" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></li> </ul> <p><span class="TextRun SCXW94985 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW94985 BCX0">Once the plugin knows how to communicate with the CML server and </span><span class="NormalTextRun SCXW94985 BCX0">which </span><span class="NormalTextRun SCXW94985 BCX0">lab to use, it can</span><span class="NormalTextRun SCXW94985 BCX0"> return information about the nodes in the lab:</span></span><span class="EOP SCXW94985 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <pre><span data-contrast="auto">ok: [hq-rtr1] =&gt; {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    "cml_facts": {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        "config": "hostname hq-rtr1\nvrf definition Mgmt-intf\n!\naddress-family ipv4\nexit-address-family\n!\naddress-family ipv6\nexit-address-family\n!\nusername admin privilege 15 secret 0 admin\ncdp run\nno aaa new-model\nip domain-name mdd.cisco.com\n!\ninterface GigabitEthernet1\nvrf forwarding Mgmt-intf\nip address dhcp\nnegotiation auto\nno cdp enable\nno shutdown\n!\ninterface GigabitEthernet2\ncdp enable\n!\ninterface GigabitEthernet3\ncdp enable\n!\ninterface GigabitEthernet4\ncdp enable\n!\nip http server\nip http secure-server\nip http max-connections 2\n!\nip ssh time-out 60\nip ssh version 2\nip ssh server algorithm encryption aes128-ctr aes192-ctr aes256-ctr\nip ssh client algorithm encryption aes128-ctr aes192-ctr aes256-ctr\n!\nline vty 0 4\nexec-timeout 30 0\nabsolute-timeout 60\nsession-limit 16\nlogin local\ntransport input ssh\n!\nend",</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        "cpus": 1,</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        "data_volume": null,</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        "image_definition": null,</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        "interfaces": [</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">            {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "ipv4_addresses": null,</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "ipv6_addresses": null,</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "mac_address": null,</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "name": "Loopback0",</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "state": "STARTED"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">            },</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">            {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "ipv4_addresses": [</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                    "192.168.255.199"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                ],</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "ipv6_addresses": [],</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "mac_address": "52:54:00:13:51:66",</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "name": "GigabitEthernet1",</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">                "state": "STARTED"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">            }</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        ],</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        "node_definition": "csr1000v",</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        "ram": 3072,</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">        "state": "BOOTED"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    }</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">}</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}">  </span></pre> <p><span class="TextRun SCXW231683743 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW231683743 BCX0">The first IPv4 address found (in order of the interfaces) is used as </span></span><span class="TextRun SCXW231683743 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="none"><span class="NormalTextRun SCXW231683743 BCX0">`</span><span class="NormalTextRun SpellingErrorV2Themed SCXW231683743 BCX0">ansible_host</span><span class="NormalTextRun SCXW231683743 BCX0">`</span></span><span class="TextRun SCXW231683743 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW231683743 BCX0"> to enable the playbook to connect to the device</span><span class="NormalTextRun SCXW231683743 BCX0">. </span><span class="NormalTextRun SCXW231683743 BCX0">We can use the </span></span><span class="TextRun SCXW231683743 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SpellingErrorV2Themed SCXW231683743 BCX0">cisco.cml.inventory</span> </span><span class="TextRun SCXW231683743 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW231683743 BCX0">playbook included in the </span><span class="NormalTextRun SCXW231683743 BCX0">collection to show the inventory</span><span class="NormalTextRun SCXW231683743 BCX0">. </span><span class="NormalTextRun SCXW231683743 BCX0">In this case, we only specify that we want devices that are in the “router” group created by the inventory plugin as informed by the tags on the devices</span><span class="NormalTextRun SCXW231683743 BCX0">:</span></span><span class="EOP SCXW231683743 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <pre><span data-contrast="auto">mdd % ansible-playbook cisco.cml.inventory --limit=router</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">ok: [hq-rtr1] =&gt; {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    "msg": "Node: hq-rtr1(csr1000v), State: BOOTED, Address: 192.168.255.199:22"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">}</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">ok: [hq-rtr2] =&gt; {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    "msg": "Node: hq-rtr2(csr1000v), State: BOOTED, Address: 192.168.255.53:22"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">}</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">ok: [site1-rtr1] =&gt; {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    "msg": "Node: site1-rtr1(csr1000v), State: BOOTED, Address: 192.168.255.63:22"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">}</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">ok: [site2-rtr1] =&gt; {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    "msg": "Node: site2-rtr1(csr1000v), State: BOOTED, Address: 192.168.255.7:22"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">}</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}">  </span></pre> <p><span class="TextRun SCXW163037751 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW163037751 BCX0">In addition to group tags, the CML dynamic inventory plugin will also parse tags to pass information from </span><span class="NormalTextRun SpellingErrorV2Themed SCXW163037751 BCX0">PATty</span><span class="NormalTextRun SCXW163037751 BCX0"> and to create generic inventory facts</span><span class="NormalTextRun SCXW163037751 BCX0">:</span></span><span class="EOP SCXW163037751 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><img loading="lazy" class="aligncenter wp-image-447911 size-large" src="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.49.36 PM-1024x707.png" alt="" width="640" height="442" srcset="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.49.36 PM-1024x707.png 1024w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.49.36 PM-300x207.png 300w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.49.36 PM-768x530.png 768w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.49.36 PM-770x533.png 770w, https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2024/01/Screenshot-2024-01-12-at-4.49.36 PM.png 1124w" sizes="(max-width: 640px) 100vw, 640px" /></p> <p>&nbsp;</p> <p><span data-contrast="auto">If a CML tag is specified that matches `^pat:(?:tcp|udp)?:?(\d+):(\d+)`, the CML server address (as opposed to the first IPv4 address found) will be used for `ansible_host`. To change `ansible_port` to point to the translated SSH port, the tag `ansible:ansible_port=2020` can be set. These two tags tell the Ansible playbook to connect to port 2020 of the CML server to automate the specified host in the topology. The `ansible:` tag can also be used to specify other host facts. For example, the tag `ansible:nso_api_port=2021` can be used to tell the playbook the port to use to reach the Cisco NSO API. Any arbitrary fact can be set in this way.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <h2><b><span data-contrast="auto">Getting started</span></b><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></h2> <p><span data-contrast="auto">Trying out the CML Ansible Collection is easy. You can use the playbooks provided in the collection to load and start a topology in your CML server. To start, define the environment variable that tells the collection how to access your CML server:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <pre><span data-contrast="auto">% export CML_HOST=my-cml-server.my-domain.com</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">% export CML_USERNAME=my-cml-username</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">% export CML_PASSWORD=my-cml-password</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></pre> <p><span class="TextRun SCXW260257956 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW260257956 BCX0">The next step is to define your topology file. This is </span><span class="NormalTextRun SCXW260257956 BCX0">a</span><span class="NormalTextRun SCXW260257956 BCX0"> standard topology file </span><span class="NormalTextRun SCXW260257956 BCX0">you </span><span class="NormalTextRun SCXW260257956 BCX0">can export from CML. There are two ways </span><span class="NormalTextRun SCXW260257956 BCX0">to define</span><span class="NormalTextRun SCXW260257956 BCX0"> th</span><span class="NormalTextRun SCXW260257956 BCX0">e topology file</span><span class="NormalTextRun SCXW260257956 BCX0">. </span><span class="NormalTextRun SCXW260257956 BCX0">First, </span><span class="NormalTextRun SCXW260257956 BCX0">you can </span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW260257956 BCX0">use  </span><span class="NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW260257956 BCX0">an</span><span class="NormalTextRun SCXW260257956 BCX0"> environment variable:</span></span><span class="EOP SCXW260257956 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <pre><span class="TextRun SCXW26966994 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW26966994 BCX0">%</span><span class="NormalTextRun SCXW26966994 BCX0"> export CML_LAB=my-cml-</span><span class="NormalTextRun SpellingErrorV2Themed SCXW26966994 BCX0">labfile</span></span><span class="EOP SCXW26966994 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></pre> <p><span class="TextRun SCXW210282808 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW210282808 BCX0">Alternatively, you can </span><span class="NormalTextRun SCXW210282808 BCX0">specify the topology file when you run the playbook as an extra</span><span class="NormalTextRun SCXW210282808 BCX0">&#8211;</span><span class="NormalTextRun SCXW210282808 BCX0">var.  </span><span class="NormalTextRun SCXW210282808 BCX0">For example, to spin up a topology using the built in </span></span><em><span class="TextRun SCXW210282808 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SpellingErrorV2Themed SCXW210282808 BCX0">cisco.cml.</span><span class="NormalTextRun SpellingErrorV2Themed SCXW210282808 BCX0">build</span></span></em><span class="TextRun SCXW210282808 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW210282808 BCX0"> playbook:</span></span><span class="EOP SCXW210282808 BCX0" data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <pre><span class="TextRun SCXW211207923 BCX0" lang="EN-US" xml:lang="EN-US" data-contrast="auto"><span class="NormalTextRun SCXW211207923 BCX0">%</span><span class="NormalTextRun SCXW211207923 BCX0"> ansible-playbook </span><span class="NormalTextRun SpellingErrorV2Themed SCXW211207923 BCX0">cisco.cml.build</span><span class="NormalTextRun SCXW211207923 BCX0"> -e wait='yes'</span><span class="NormalTextRun SCXW211207923 BCX0"> -e</span> <span class="NormalTextRun CommentStart SpellingErrorV2Themed CommentHighlightPipeRest CommentHighlightRest SCXW211207923 BCX0">cml_lab_file</span><span class="NormalTextRun CommentHighlightRest SCXW211207923 BCX0">=</span><span class="NormalTextRun SpellingErrorV2Themed CommentHighlightRest SCXW211207923 BCX0">topology.yaml</span></span> </pre> <p><span data-contrast="auto">This command loads and starts the topology; then it waits until all nodes are running to complete.  If </span><em>-e startup=&#8217;host&#8217;</em><span data-contrast="auto"> is specified, the playbook will start each host individually as opposed to starting them all at once.  This allows for the config to be generated and fed into the host on startup.  When </span><span data-contrast="auto">cml_config_file </span><span data-contrast="auto">is defined in the host’s inventory, it is parsed as a Jinja file and fed into that host as config at startup.  This allows for just-in-time configuration to occur.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">Once the playbook completes, you can use another built-in playbook, </span><em>cisco.cml.inventory</em><span data-contrast="auto">, to get the inventory for the topology.  In order to use it, first create a </span><em>cml.yml</em><span data-contrast="auto"> in the inventory directory as shown above, then run the playbook as follows:</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <pre><span data-contrast="auto">% ansible-playbook cisco.cml.inventory</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">PLAY [cml_hosts] **********************************************************************</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">TASK [debug] **********************************************************************</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">ok: [WAN-rtr1] =&gt; {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    "msg": "Node: WAN-rtr1(csr1000v), State: BOOTED, Address: 192.168.255.53:22"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">}</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">ok: [nso1] =&gt; {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    "msg": "Node: nso1(ubuntu), State: BOOTED, Address: my-cml-server.my-domain.com:2010"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">}</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">ok: [site1-host1] =&gt; {</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">    "msg": "Node: site1-host1(ubuntu), State: BOOTED, Address: site1-host1:22"</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span> <span data-contrast="auto">}</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></pre> <p><span data-contrast="auto">In this truncated output, three different scenarios are shown.  First, </span><em>WAN-rtr1</em><span data-contrast="auto"> is assigned the DHCP address it received for its </span><span data-contrast="auto">ansible_host </span><span data-contrast="auto">value, and </span><em>ansible port </em><span data-contrast="auto">is</span><span data-contrast="auto"><em> 22</em>.</span><span data-contrast="auto"> If the host running the playbook has IP connectivity (either in the topology or a network connected to the topology with an external connector), it will be able to reach that host.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">The second scenario shows an example of the PATty functionality with the host </span><em>nso1</em><span data-contrast="auto"> in which the dynamic inventory plugin reads those tags to determine that the host is available through the CML server’s interface (i.e. </span><em>ansible_host</em><span data-contrast="auto"> is set to </span><span data-contrast="auto"><em>my-cml-server.my-domain.com</em>)</span><span data-contrast="auto">.  Also, it knows that ansible_port should be set to the port specified in the tags (i.e. 2010).  After these values are set, the ansible playbook can reach the host in the topology using the PATty functionality in CML.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">The last example, </span><span data-contrast="auto"><em>site1-host1</em>,</span><span data-contrast="auto"> shows the scenario in which the CML dynamic inventory script can either find a DHCP allocated address or tags to specify to what </span><em>ansible_host</em><span data-contrast="auto"> should be set, so it uses the node name.  For the playbook to reach those hosts, it would have to have IP connectivity and be able to resolve the node name to an IP address.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">These built-in playbooks show examples of how to use the functionality in the CML Ansible Collection to build your own playbooks, but you can also use them directly as part of your pipeline.  In fact, we often use them directly in the pipelines we build for customers.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto">If you want to learn more about the CML Ansible Collection, you can find it in Ansible Galaxy <a href="https://github.com/ciscodevnet/ansible-cml">as well as on Github</a>.</span><span data-ccp-props="{&quot;201341983&quot;:0,&quot;335559739&quot;:160,&quot;335559740&quot;:259}"> </span></p> <p><span data-contrast="auto"><a href="https://github.com/model-driven-devops/mdd">You can also find a full, IaC CI/CD pipeline using these modules here</a>.</span></p> <p>&nbsp;</p> <p style="text-align: center;">Join the <a href="https://learningnetwork.cisco.com/s/?ccid=learning&amp;dtid=blog&amp;oid=blog-cisco-footer">Cisco Learning Network</a> today for free.</p> <blockquote> <h2 style="text-align: center;"><strong>Follow Cisco Learning &amp; Certifications</strong></h2> <h3 style="text-align: center;"><strong><a href="https://twitter.com/LearningatCisco">Twitter</a> | <a href="https://www.facebook.com/learningatcisco">Facebook</a> | <a href="https://www.linkedin.com/showcase/cisco_training_and_certification">LinkedIn</a> | <a href="https://www.instagram.com/learningatcisco/">Instagram</a></strong><strong> | <a href="https://www.youtube.com/@CiscoUtube">YouTube</a></strong></h3> </blockquote> <p style="text-align: center;">Use <strong>#CiscoCert</strong> to join the conversation.</p> <div id="share_bar_desktop"> <span class = "share_title">Share</span> <div class="twitter"> <div class = "box"> <a class = "share" href="https://twitter.com/intent/tweet?url=https://blogs.cisco.com/learning/how-to-use-ansible-with-cml&text=How to Use Ansible with CML&via=LearningatCisco" target='_blank' data-config-metrics-group='social_shares' data-config-metrics-title='twitter_shares' data-config-metrics-item='twitter_share'> <img class="share_image" src="https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/svg/share_X_white.svg" alt="share on twitter"></a> </div> </div> <div class="facebook"> <div class = "box"> <a class = "share" href = "http://www.facebook.com/sharer/sharer.php?u=https://blogs.cisco.com/learning/how-to-use-ansible-with-cml&title=How to Use Ansible with CML" data-config-metrics-group='social_shares' data-config-metrics-title='facebook_shares' data-config-metrics-item='facebook_share' onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img class="share_image" src="https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/svg/share_fb_white.svg" alt="share on facebook"></a> </div> </div> <div class="linkedin"> <div class = "box"> <a class = "share" href = "https://www.linkedin.com/cws/share?url=https://blogs.cisco.com/learning/how-to-use-ansible-with-cml" data-title=" " data-config-metrics-group='social_shares' data-config-metrics-title='linkedin_shares' data-config-metrics-item='linkedin_share' onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img class="share_image" src="https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/svg/share_li_white.svg" alt="share on linkedin"></a> </div> </div> <div class = "mail"> <div class = "box"> <a class="share" href="mailto:?subject=Cisco Blog: How to Use Ansible with CML&body=I saw this post on Cisco Blogs and thought you might like to read it.%0A%0AHow to Use Ansible with CML%0A%0Ahttps://blogs.cisco.com/learning/how-to-use-ansible-with-cml%0A%0A****Disclaimer****%0A%0ACisco is not responsible for the content of this email, and its contents do not necessarily reflect Cisco’s views or opinions. Cisco has not verified the email address or name of the sender." data-config-metrics-group='social_shares' data-config-metrics-title='email_shares' data-config-metrics-item='email_share'> <img class="share_image" src="https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/svg/share_email_white.svg"> </a> </div> </div> <div class = "clear"></div> </div> <br> <div class = "share_text">Share:</div> <div id="share_bar_mobile"> <div class="twitter"> <div class = "box"> <a class = "share" href="https://twitter.com/intent/tweet?url=https://blogs.cisco.com/learning/how-to-use-ansible-with-cml&text=How to Use Ansible with CML&via=LearningatCisco" target='_blank' data-config-metrics-group='social_shares' data-config-metrics-title='twitter_shares' data-config-metrics-item='twitter_share'> <img class="share_image" src="https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/svg/share_X_white.svg" alt="share on twitter"></a> </div> </div> <div class="facebook"> <div class = "box"> <a class = "share" href = "http://www.facebook.com/sharer/sharer.php?u=https://blogs.cisco.com/learning/how-to-use-ansible-with-cml&title=How to Use Ansible with CML" data-config-metrics-group='social_shares' data-config-metrics-title='facebook_shares' data-config-metrics-item='facebook_share' onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img class="share_image" src="https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/svg/share_fb_white.svg" alt="share on facebook"></a> </div> </div> <div class="linkedin"> <div class = "box"> <a class = "share" href = "https://www.linkedin.com/cws/share?url=https://blogs.cisco.com/learning/how-to-use-ansible-with-cml" data-title=" " data-config-metrics-group='social_shares' data-config-metrics-title='linkedin_shares' data-config-metrics-item='linkedin_share' onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;"><img class="share_image" src="https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/svg/share_li_white.svg" alt="share on linkedin"></a> </div> </div> <div class = "mail"> <div class = "box"> <a class="share" href="mailto:?subject=Cisco Blog: How to Use Ansible with CML&body=I saw this post on Cisco Blogs and thought you might like to read it.%0A%0AHow to Use Ansible with CML%0A%0Ahttps://blogs.cisco.com/learning/how-to-use-ansible-with-cml%0A%0A****Disclaimer****%0A%0ACisco is not responsible for the content of this email, and its contents do not necessarily reflect Cisco’s views or opinions. Cisco has not verified the email address or name of the sender." data-config-metrics-group='social_shares' data-config-metrics-title='email_shares' data-config-metrics-item='email_share'> <img class="share_image" src="https://blogs.cisco.com/wp-content/themes/ciscowordpress-child/svg/share_email_white.svg"> </a> </div> </div> <div class = "clear"></div> </div> <br> </div><!-- .entry-content --> <div class="author-section"> <div><h2>Authors</h2></div> <div class="auth-row"> <div class="blog-row author-bio"> <div class="item-thirds-1 author-bio-box" > <div class="author-image" > <a href="https://blogs.cisco.com/author/stevencarter"><img src="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2022/07/1537493695-bpfull.jpg" width="150" height="150" alt="Avatar" class="avatar avatar-150wp-user-avatar wp-user-avatar-150 alignnone photo avatar-default"> </a> </div> <div class="author-info"> <h3><a href="https://blogs.cisco.com/author/stevencarter"> Steven Carter</a> </h3> <h4 class="title">Solutions Architect </h4> <h4>Cisco US Public Sector</h4> </div> </div><!--end author image and name--> </div><!-- .author-bio --> </div> </div> <footer class="entry-footer"> </footer><!-- .entry-footer --> </article> <div id="tags-container">Tags: <a href="https://blogs.cisco.com/tag/ansible" rel="tag">Ansible</a> <a href="https://blogs.cisco.com/tag/cisco-modeling-labs" rel="tag">Cisco Modeling Labs</a> <a href="https://blogs.cisco.com/tag/devops" rel="tag">devops</a> <hr id="comment-break-line"> </div> <div id="comments" class="comments-area"> <h2 class="comments-title"> One Comment </h2><!-- .comments-title --> <ul class="comment-list"> <li id="comment-2568052" class="comment even thread-even depth-1"> <article id="div-comment-2568052" class="comment-body"> <footer class="comment-meta"> <div class="comment-author vcard"> <img src="https://storage.googleapis.com/blogs-images-new/ciscoblogs/1/2020/08/cisco_logo.png" width="32" height="23" alt="Avatar" class="avatar avatar-32wp-user-avatar wp-user-avatar-32 alignnone photo avatar-default" /> <b class="fn">Anonymous</b> <span class="says">says:</span> </div><!-- .comment-author --> <div class="comment-metadata"> <a href="https://blogs.cisco.com/learning/how-to-use-ansible-with-cml#comment-2568052"><time datetime="2024-01-18T02:59:54-08:00">January 18, 2024 at 2:59 am</time></a> </div><!-- .comment-metadata --> </footer><!-- .comment-meta --> <div class="comment-content"> <p>Steven is one of the true experts in this area, great blog and read. If you have not read his book Model-Driven DevOps, it is a must read.</p> </div><!-- .comment-content --> </article><!-- .comment-body --> </li><!-- #comment-## --> </ul><!-- .comment-list --> <p class="no-comments">Comments are closed.</p> </div><!-- #comments --> </main><!-- #main --> </div><!-- #primary --> </div><!-- #content --> <!-- Open Social Footer --> <div id="social-footer" class="blog-row"> <ul class="social-footer-item item-full"> <h5> CONNECT WITH US </h5> <ul id="social-icons-list"> <li> <a href="https://www.linkedin.com/company/cisco/" target="_blank" rel=”noopener noreferrer” tabindex="0" alt="Go to Cisco's LinkedIn"><svg width="32" height="32" viewBox="0 0 32 32" role="img" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="m24.80382,24.53603l-3.70694,0l0,-5.62559c0,-1.34209 -0.02431,-3.06801 -1.92709,-3.06801c-1.92986,0 -2.22361,1.46262 -2.22361,2.97171l0,5.72189l-3.70347,0l0,-11.56902l3.55417,0l0,1.58181l0.05069,0c0.49445,-0.90976 1.70486,-1.86868 3.50903,-1.86868c3.75347,0 4.44722,2.39528 4.44722,5.51111l0,6.34478zm-15.74236,-13.1495c-1.19097,0 -2.15139,-0.934 -2.15139,-2.08552c0,-1.15084 0.96042,-2.08485 2.15139,-2.08485c1.18611,0 2.14931,0.93401 2.14931,2.08485c0,1.15152 -0.9632,2.08552 -2.14931,2.08552l0,0zm1.85486,13.1495l0,-11.56902l-3.71111,0l0,11.56902l3.71111,0zm15.73403,-20.65724l-21.30556,0c-1.01736,0 -1.84444,0.78249 -1.84444,1.74815l0,20.74545c0,0.96499 0.82708,1.74882 1.84444,1.74882l21.30556,0c1.02014,0 1.84931,-0.78383 1.84931,-1.74882l0,-20.74545c0,-0.96566 -0.82917,-1.74815 -1.84931,-1.74815l0,0z" fill="#fff" fill-rule="evenodd"></path></svg></a></li> <li> <a href="https://twitter.com/LearningatCisco" target="_blank" rel=”noopener noreferrer” tabindex="0" alt="Go to Cisco's Twitter"><svg width="32" height="32" viewBox="0 0 32 32" role="img" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <path d="M25.2019 2H30.1087L19.3887 13.8605L32 30H22.1254L14.3913 20.2115L5.54174 30H0.631901L12.0981 17.3138L0 2H10.1252L17.1162 10.9471L25.2019 2ZM23.4797 27.1569H26.1987L8.64785 4.69374H5.73013L23.4797 27.1569Z" fill="#fff"/> </svg></a></li> <li> <a href="https://www.facebook.com/cisco/" target="_blank" rel=”noopener noreferrer” tabindex="0" alt="Go to Cisco's Facebook"><svg width="32" height="32" viewBox="0 0 32 32" role="img" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="m26.62006,4l-22.2403,0c-0.7622,0 -1.37976,0.59894 -1.37976,1.33804l0,21.56635c0,0.73891 0.61756,1.33803 1.37976,1.33803l11.97343,0l0,-9.38796l-3.25793,0l0,-3.65868l3.25793,0l0,-2.69815c0,-3.13113 1.97213,-4.83613 4.85266,-4.83613c1.37975,0 2.56571,0.09955 2.91135,0.14415l0,3.2722l-1.99788,0.00091c-1.56654,0 -1.86993,0.72183 -1.86993,1.7812l0,2.33582l3.7362,0l-0.48652,3.65868l-3.24968,0l0,9.38796l6.37067,0c0.76191,0 1.37975,-0.59912 1.37975,-1.33803l0,-21.56635c0,-0.7391 -0.61784,-1.33804 -1.37975,-1.33804" fill="#fff"></path></svg></a></li> <li> <a href="https://www.instagram.com/cisco/?hl=en" target="_blank" rel=”noopener noreferrer” tabindex="0" alt= "Go to Cisco's Instagram"><svg width="32" height="32" viewBox="0 0 32 32" role="img" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g fill="#fff"><path d="m22.23823,2.07724l-12.4768,0c-4.23706,0 -7.68419,3.44729 -7.68419,7.68435l0,12.4768c0,4.23723 3.44713,7.68436 7.68419,7.68436l12.4768,0c4.23739,0 7.68452,-3.4473 7.68452,-7.68436l0,-12.4768c0.00016,-4.23706 -3.44713,-7.68435 -7.68452,-7.68435zm5.21409,20.16115c0,2.87494 -2.33899,5.21377 -5.21393,5.21377l-12.47696,0c-2.87478,0.00016 -5.2136,-2.33883 -5.2136,-5.21377l0,-12.4768c0,-2.87477 2.33882,-5.21376 5.2136,-5.21376l12.4768,0c2.87494,0 5.21393,2.33899 5.21393,5.21376l0,12.4768l0.00016,0z"></path><path d="m15.99999,8.82524c-3.9564,0 -7.17508,3.21868 -7.17508,7.17508c0,3.95624 3.21868,7.17476 7.17508,7.17476c3.9564,0 7.17509,-3.21852 7.17509,-7.17476c0,-3.9564 -3.21869,-7.17508 -7.17509,-7.17508zm0,11.87908c-2.59395,0 -4.70449,-2.11021 -4.70449,-4.70416c0,-2.59412 2.11038,-4.7045 4.70449,-4.7045c2.59412,0 4.7045,2.11038 4.7045,4.7045c0,2.59395 -2.11054,4.70416 -4.7045,4.70416z"></path><path d="m23.47599,6.73035c-0.476,0 -0.9436,0.1927 -1.27976,0.53035c-0.33781,0.336 -0.532,0.80376 -0.532,1.28141c0,0.47617 0.19435,0.94377 0.532,1.28141c0.336,0.336 0.80376,0.53036 1.27976,0.53036c0.47765,0 0.94377,-0.19436 1.28141,-0.53036c0.33765,-0.33764 0.53036,-0.80541 0.53036,-1.28141c0,-0.47765 -0.19271,-0.94541 -0.53036,-1.28141c-0.336,-0.33765 -0.80376,-0.53035 -1.28141,-0.53035z"></path></g></svg></a></li> <li> <a href="https://www.youtube.com/user/Cisco/welcome" target="_blank" rel=”noopener noreferrer” tabindex="0" alt="Go to Cisco's Youtube"><svg width="32" height="32" viewBox="0 0 32 32" role="img" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="m12.73901,19.93335l-0.00144,-8.54172l8.47104,4.28574l-8.4696,4.25598zm18.59878,-10.02146c0,0 -0.30631,-2.09493 -1.24635,-3.01746c-1.19214,-1.21081 -2.52842,-1.21682 -3.14122,-1.28769c-4.38704,-0.30753 -10.96784,-0.30753 -10.96784,-0.30753l-0.01363,0c0,0 -6.58064,0 -10.96784,0.30753c-0.61283,0.07087 -1.94862,0.07688 -3.14119,1.28769c-0.93998,0.92253 -1.24586,3.01746 -1.24586,3.01746c0,0 -0.31352,2.46013 -0.31352,4.92024l0,2.30635c0,2.46008 0.31352,4.92018 0.31352,4.92018c0,0 0.30588,2.09496 1.24586,3.01749c1.19257,1.21085 2.7591,1.17254 3.45682,1.29945c2.50808,0.23321 10.65906,0.30539 10.65906,0.30539c0,0 6.58758,-0.00962 10.97462,-0.31712c0.6128,-0.07089 1.94908,-0.07687 3.14122,-1.28772c0.94004,-0.92253 1.24635,-3.01749 1.24635,-3.01749c0,0 0.31306,-2.4601 0.31306,-4.92018l0,-2.30635c0,-2.46011 -0.31306,-4.92024 -0.31306,-4.92024l0,0z" fill="#fff"></path></svg></a></li> </ul> </ul> </div> <!-- Close Social Footer --> </cdc-template-micro> <!-- close cdc-template--> </div><!-- #page --> <script type="text/javascript" src="//www.cisco.com/c/dam/cdc/t/ctm.js"></script> <script> function convert_to_url(obj) { return Object .keys(obj) .map(k => `${encodeURIComponent(k)}=${encodeURIComponent(obj[k])}`) .join('&'); } function pass_to_backend() { if(window.location.hash) { var hash = window.location.hash; var elements = {}; hash.split("#")[1].split("&").forEach(element => { var vars = element.split("="); elements[vars[0]] = vars[1]; }); if(("access_token" in elements) || ("id_token" in elements) || ("token" in elements)) { if(window.location.href.indexOf("?") !== -1) { window.location = (window.location.href.split("?")[0] + window.location.hash).split('#')[0] + "?" + convert_to_url(elements); } else { window.location = window.location.href.split('#')[0] + "?" + convert_to_url(elements); } } } } pass_to_backend(); </script> <script type='text/javascript' src='https://blogs.cisco.com/wp-content/themes/ciscowordpress/js/navigation.js?ver=20151215' id='ciscowordpress-navigation-js'></script> <script type='text/javascript' src='https://blogs.cisco.com/wp-content/themes/ciscowordpress/js/skip-link-focus-fix.js?ver=20151215' id='ciscowordpress-skip-link-focus-fix-js'></script> </body> </html> <!-- Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/ Served from: blogs.cisco.com @ 2024-11-23 12:45:02 by W3 Total Cache -->

Pages: 1 2 3 4 5 6 7 8 9 10