Ansible Overview

ansible-architecture-ipcisco

Ansible Tutorial

In this lesson, we will focus on Ansible. You can use this lesson as a brief Ansible Tutorial. Ansible is one of the most popular open source Automation Software like Puppet. It is writtten in Python Language and it is available in Linux like RedHat, Debian, Ubuntu etc. and Mac. To overcome routine tasks in a network and reduce manual configurations and settings, Ansible is a perfect tool. You can also access Ansible website, here.

 


You can check also Ansible vs Puppet vs Chef Lesson that we compare three Network Automation Tools.


 

ansible-overview-ipcisco

There are various use cases of Ansible Automation Software. These uses cases are :

 

  • Provisioning Activities
  • Configuration Management
  • Network Management
  • Security
  • Continuous Delivery
  • Ochestration
  • Application Development

 

So, what are the main features of Ansible? You can find the key features of this popular Automation Software below:

 

  • Ansiple is Free and Open Source
  • It is a simple Automation Software
  • Ansible is written by Python.
  • Ansible uses very simple YAML
  • It models all your infrastrcuture by describing interrelation of you systems.
  • It uses SSL to connect the servers.
  • Ansible is Agentless unlike Puppet and Chef. You do not need to install anything to the remote device.
  • To use ansible Python must be configured or with raw module it can be used on the systems that has no Python.
  • Ansible uses YAML as extention.

 

Ansible Architecture

Ansible Architecture consist of some parts, and each of these parts has special duty in this architecture.

ansible-architecture-ipcisco

Ansible Orchestration Engine consist of four main parts. These are :

  • Inventory
  • Modules
  • APIs
  • Plugins

 

Beside Ansible Orchestration Engine, in Ansible Architecture there are other parts like below:

  • Playbook
  • Hosts
  • CMDB
  • Networking
  • Cloud

 

Now, let’s explaint each of these parts one bu one.

 

Inventory file is the file that is also called as “hosts”. Because it contains the nodes, their ip addresses, databases, servers etc. which will be managed.

 

Inventory file can be created like below:

[app]

192.168.1.1

192.168.2.2

 

[db]

192.168.3.3

192.168.4.4

 

Playbook is the file that contains codes written in YAML format. All the configuration files are written in this human readable language. It includes the tasks that will be done by Ansible. In other words, it is the place, where Ansible actions are stored. You can find an example YAML file below:

 

hostname: Backbone-Node-1

address1: 192.168.1.1

mask1: 255.255.255.0

address2: 192.168.2.2

mask2: 255.255.255.0

address2: 192.168.3.3

mask2: 255.255.255.0

 

Modules are the parts of Ansible architecture that are executed by Ansible and then removed after finished. They can be on any device, there is no need for any server or databases. We can run a single modüle for a tas kor run multiple modules in Playbook.

 Plugins are also some codes that increases Anssible capability. You can use known plugins or you can write a plugin by yourself to sue with Ansible.

APIs in Ansible is used as transport mechanism for cloud services.

Hosts are the devices that we will automate by Ansible.

CMDB (Configuration Management Database) is a repository that stores entire infrastructure.

Networking is the part that helps to automate different networks that makes use of all agentless framework and egnerate configurations.

Cloud is the part that includes remote servers on internet that store, manage and process data.

 


You can check also Ansible vs Puppet vs Chef Lesson that we compare three Network Automation Tools.


 

How Ansible Works?

The main difference between Ansible and the other Automation programs is, to use ansible, you do not require to install Agents and Servers. Easily you can install Ansible on the device and then it is ready to be used.

In this Ansible Tutorial, let’s talk about Ansible operation models. There are two operation models of Ansible. These operation models are:

  • Push Model
  • Pull Model

 

So what are the main differences of these two model? First of all, in Push Model, the workstation calls the server.  But in Pull Model the server pulls the code from the repository. Although Push Model is slower for large networks, Pull Model is faster. And in Push Model, execution is immediate but in Pull Model, it is not.

 

Now, let’s explain Push Model. Before this explanation, let’s see the files used in Ansible. There are different files in Ansible Architecture. These Ansible files are:

  • Playbook
  • Inventory
  • Templates
  • Variables

 

We have talked about Playbook and Inventory before. Templates are the device configurations written by Jinja2 language with variables.And Variables written in YAML language and used into templates.

how-ansible-works-ipcisco

Let’s explain Ansible Operation steps:

Back to: CCNA 200-301 v1.1 > Automation and Programmability

Leave a Reply

Your email address will not be published. Required fields are marked *

CCNA 200-301 v1.1

Collapse
Expand
Latest Blog Posts