Ansible Network Automation: Introduction & Installation

Ansible Network Automation: Introduction & Installation

Ansible is a very popular open source automation platform. It was originally written by Michael DeHaan. Ansible began as a project, sometime in February of 2012 and was acquired by Red Hat in 2015.

Ansible makes the network more secure, and at the same time more agile and adaptable. Ansible is a Python-based, command-line engine that interprets and executes human readable, text-based playbooks in YAML format. Playbooks contain one or more plays that perform tasks in sequence.

Ansible Network modules extend the benefits of simple, powerful, agentless automation to network administrators and teams. Ansible Network modules can configure your network stack, test and validate existing network state, and discover and correct network configuration drift.


Ansible collections support a wide range of vendors, device types, and actions, with Ansible, you can:

  • Automate repetitive tasks to speed routine network changes and free up your time for more strategic work
  • Leverage the same simple, powerful, and agentless automation tool for network tasks that operations and development use
  • Separate the data model (in a playbook or role) from the execution layer (through Ansible modules) to manage heterogeneous network devices
  • Communicate securely with network hardware over SSH or HTTPS
  • Benefit from community and vendor-generated sample playbooks and roles to help accelerate network automation projects


Ansible Installation steps on CentOS

Below are simple 3 steps to install Ansible on CentOS

Step 1:

Update the existing operating system

yum update        

Step 2:

Install the EPEL (Extra Packages for Enterprise Linux) repository on the system to provide easy access to install commonly used packages on CentOS.

yum install epel-release        

Step 3:

Install the Ansible package from the community maintained?EPEL repository.

yum install ansible        

Confirm Ansible is installed by running?ansible --version command

No alt text provided for this image

How Ansible Works

Ansible’s main strengths are simplicity. It also has a strong focus on security and reliability. It uses OpenSSH for transport (with other transports and pull modes as alternatives), and uses a human-readable language that is designed for getting started quickly.


Ansible Automation Platform have the concept of a control node and a managed node. The control node is where Ansible is executed from, for example where a user runs the ansible-playbook command. Managed nodes are the devices being automated, for example a Cisco router.

Ansible works by connecting to managed nodes and pushing out small programs, called "Ansible modules" to them. These programs are written to be resource models of the desired state of the system. Ansible then executes these modules (over SSH by default), and removes them when finished.?

No alt text provided for this image

In next article we will clarify in more details the components of Ansible platform.

Ahmed Fouad Mansour CCIERS wr, JNCIP-SP

Riverbed Senior Professional Services Consultant | Network Performance Monitoring | Application Performance Monitoring | NPM | APM | ITOM | Observability | RCPE | NetIM | NetProfiler | Riverbed Technology

1 年

Thanks Ibrahim, it is actually a good intro

要查看或添加评论,请登录

Ibrahim ElSawy的更多文章

  • Ansible Network Automation: Modules

    Ansible Network Automation: Modules

    In today's hyper-connected world, where the demand for faster, more reliable, and secure networks continues to grow…

  • Ansible Network Automation: Architecture & Playbook example

    Ansible Network Automation: Architecture & Playbook example

    I liked how ansible is being designed in a very simple architecture to operate with any network element without adding…

  • Nexus 9K: Setting Boot Variables

    Nexus 9K: Setting Boot Variables

    N9K switch failed to boot from NXOS stored on bootflash NXS-SW-01# show boot Current Boot Variables: sup-1 NXOS…

    1 条评论
  • Virtual Port Channels

    Virtual Port Channels

    A virtual port channel (vPC) allows links that are physically connected to two different Cisco Nexus 7000 or 9000…

社区洞察

其他会员也浏览了