Technology / System Admin

What is Ansible?

What is Ansible
Follow us
Published on November 17, 2022

Ansible was originally created by Red Hat. It’s a handy tool used for network automation. However, Ansible can also be used for system administration. 

We’re going to highlight and discuss the key features of Ansible. However, if you want to take a deeper dive into Ansible training or need to learn how to configure Ansible right now, look at Jon McGovern’s Ansible training at CBT Nuggets. 

An Overview of Ansible

In this video, CBT Nuggets trainer John McGovern discusses what Ansible is, how it can benefit network and systems admins, and more. 

Configuring Ansible to Push or Pull Configurations for Network Automation

Ansible supports both pushing and pulling configurations to and from devices. Remember that Ansible can be used for both network automation and systems administration.

Computers are versatile and can be utilized for all sorts of different tasks. Because they are generalized pieces of equipment, that also makes them more difficult to manage. Hence the reason things like SCCM and Active Directory exist. 

Extending on that comparison, just like Active directory and SCCM, Ansible needs a service to communicate with. It’s the responsibility of this service to reach out to the Ansible endpoint to see if it needs to pull new updates, so it uses a pull model. 

However, equipment like routers and switches serve very specific functions. It’s the nature of things that as they become more simplistic, they are less versatile. So, there are fewer tools to manage pieces of networking equipment. 

In this case, Ansible uses SSH to log into networking hardware to make configuration changes. Ansible pushes updates from itself to that hardware, so this is a push model. 

Ansible is designed to be versatile enough to support both push and pull models to manage different types of IT gear. 

Is Ansible Procedural or Declarative?

There are two types of instructions: procedural and declarative. Declarative instructions are like Webster’s Dictionary or a cake recipe. They simply state what the definitions, or values of configuration settings, are. The thing reading those instructions already understands how to apply the values. 

Procedural instructions are like Ikea instructions except with words. If you have ever written a Windows or Bash script, that’s a procedural instruction set. Instead of listing values, procedural instructions define specific steps to complete a procedure. For instance, put screw A into hole 32B in your HiggenDorferBlatzenBerry ladder shelf to finish assembling shelf Y. 

Ansible uses procedural instructions. 

How Does Ansible Use RestConf and NetConf?

In the section above, we explained that Ansible uses procedural instructions and explained what procedural instructions are. But if Ansible uses procedural instruction sets, how is Ansible compatible with RestConf and NetConf?

Ansible isn’t a micromanager (you know who you are…). Though Ansible technically uses a procedural model, it’s a flexible configuration manager. It’ll be happy to take declarative instructions for RestConf and NetConf. 

Is Ansible Training Required to Learn All the Python Bits?

Python, meet Ansible. You might have heard that Ansible is Python driven. While that’s true, that doesn’t mean that you need to be a Python Guru to use Ansible. 

Ansible uses a language called YAML alongside Python. Wikipedia describes YAML as being a "human-readable data-serialization language", but it’s basically XML with fewer tags and syntax. 

That less-fancy XML is written in a file called a Playbook. Playbooks are configuration files for Ansible. Ansible converts the YAML instructions into Python under its hood. Then Ansible executes that code to push configurations to network equipment. 

How Else is Ansible Useful for Network Automation?

If you happen to be a Python guru, it’s certainly possible to write scripts that manage your networking hardware for you. There’s a drawback, though. Unless you have a trick up your sleeve, your automation scripts are going to use for loops. That means only one piece of hardware will be configured at a time. 

Ansible reaches out to all devices concurrently. So, when you push a new configuration, all equipment is updated at once. 

Our final point regards equipment inventory. One of the coolest features Ansible offers is being able to track the inventory of your hardware. How and why are a discussion for a different day. 

Ready to Learn Ansible?

Are you ready to learn a little network automation? Try a CBT Nuggets Ansible training course. John McGovern makes learning how to configure Ansible as easy as blue-screening Windows ME. 


Download

By submitting this form you agree to receive marketing emails from CBT Nuggets and that you have read, understood and are able to consent to our privacy policy.


Don't miss out!Get great content
delivered to your inbox.

By submitting this form you agree to receive marketing emails from CBT Nuggets and that you have read, understood and are able to consent to our privacy policy.

Recommended Articles

Get CBT Nuggets IT training news and resources

I have read and understood the privacy policy and am able to consent to it.

© 2024 CBT Nuggets. All rights reserved.Terms | Privacy Policy | Accessibility | Sitemap | 2850 Crescent Avenue, Eugene, OR 97408 | 541-284-5522