Cisco Blogs
Share

Extending Ansible Automation to Cisco UCS and Nexus


April 4, 2017 - 7 Comments

Administrators can use now use Ansible as their common tool for configuration management, deployment, and orchestration of Cisco UCS standalone rack servers and Cisco Nexus. Ansible can help you set up infrastructure quickly and easily.

Guest Blogger: David Soper, Technical Marketing Engineer

One of the goals of many organizations implementing DevOps initiatives is to simplify operations by reducing the number of tools used by teams while automating application delivery and infrastructure deployments. The new integration of Cisco Integrated Management Controller (IMC) with Ansible extends the capabilities already offered on Cisco Nexus switches to Cisco UCS C-Series Rack servers. Now system administrators can to efficiently manage, automate, and orchestrate their standalone environments with this popular tool.

Benefits of Ansible and UCS

Ansible allows the user to define desired state/settings for their infrastructure without worrying about specific programming steps to reach that state. Put another way, the user can simply describe what they want the infrastructure to look like, and Ansible will determine how to “make it so”.  Maintaining desired state means that Ansible handles all the dirty work of checking the current configuration and only making changes when needed – this is a big advantage over traditional scripting where the programmer has to handle putting a system into a certain state.

How Ansible Works

Ansible also provides an excellent framework for organizing the data used in infrastructure configuration management. The endpoints managed and roles those endpoints should be configured into are specified in a straightforward and human readable markup language (YAML). Ansible performs automation and orchestration of IT environments via Playbooks. The Playbooks are a YAML definition of a series of ‘plays’ that define automation across a set of hosts, known as the ‘inventory’. Each ‘play’ consists of multiple ‘tasks,’ that can target one, many, or all of the hosts in the inventory. Each task is a call to an Ansible module; a module is a piece of code for doing a specific task.

Ansible is written in Python. The module for the standalone UCS servers is built on the IMC Python SDK from Cisco which provides programmatic interfaces to all server components. Ansible is an agentless tool that runs in a ‘push’ model, so it doesn’t require a software agent to be installed on the target node (a server or switch) in order to automate the device. It manages remote machines over SSH (Linux and UNIX) or WinRM (Windows).

Cisco IMC Ansible Module

Cisco has published an Ansible module for managing standalone Cisco UCS C-Series servers using the remote management frameworks in Cisco IMC. The Ansible modules for Cisco’s IMC contain several examples of configuring servers into certain roles. Ansible’s role based data organization and simple YAML definition files allow users to efficiently build out large scale deployments without constantly reorganizing the data used in configuring the infrastructure.

Ansible and Cisco’s IMC In Action

I created this new demo video, so you could see how Ansible works with Cisco IMC:

Ansible Support for Nexus

Cisco added support for Ansible and the Nexus® 9000 and Nexus 3000 series switches last May by using Ansible’s open and extensible framework along with the NX-API. The NX-API is a REST-like API for NX-OS based systems. It allows network administrators and programmers to send CLI commands in an API call down to a network device. No expect scripting is required, because nearly all the communication for NX-API uses structured data.  Ansible modules make API calls against the NX-API to gather real-time state data and to make configuration changes on Cisco Nexus devices.

Our goal is to add greater automation while trying to simplify daily tasks. We are constantly working with Red Hat and our ecosystem partners to extend and enhance the capabilities of their tools to support Cisco infrastructure. Stay tuned for additional Ansible integrations in the near future.

For more information:

Cisco IMC Ansible Module Overview

Network Automation with Ansible and Cisco Nexus Switches

In an effort to keep conversations fresh, Cisco Blogs closes comments after 60 days. Please visit the Cisco Blogs hub page for the latest content.

7 Comments

  1. Some more good press for python a most flexible language. Make it so No 1 and they did with Ansible

  2. Simply wish to say your article is as surprising. The clarity for your submit is simply excellent and that i can suppose you're a professional in this subject. Well with your permission allow me to seize your feed to stay updated with approaching post. Thank you a million and please keep up the rewarding work. http://foxtrot-allegory.com/index.php?do=/event/33618/astonishing-insights-online-reputation-management/

  3. Any plans for a cisco sponsored UCS Manager Ansible integration? for like creating vlans etc?

    • A module for UCS Manager (UCSM) is being actively developed and will be posted to https://github.com/CiscoUcs soon!

      • What's the reasoning behind hosting it on your own GitHub repo and not getting the Cisco modules into the official ansible repo? It would be much easier to find and use for customers, like the really good nxos module. regards, Michael

        • We are working on hosting on the Ansible Galaxy, but licensing is still being reviewed between Cisco and Ansible.

  4. Nice.