Is Ansible free?
Yes, Ansible is an absolutely free and open source tool that is used for the above-mentioned purposes. Because Ansible adopts the standard GNU (General Public License), it can be used for commercial purposes as well as long as one respects the policies of GNU.
- The CLI based usage is free with no limits.
- Ansible Tower offers free for handling up to 10 nodes. Anything more than that might require a paid license. Ansible Tower provides a neat graphical user interface with a dashboard using which one can group the hosts, variables, jobs, etc.
- Ansible AWX is free i.e an open source upstream project for Ansible Tower.
What is Ansible?
Ansible is a simple modern IT automation engine that automates the configuration management of thousands of servers, cloud provisioning, application deployment, etc. Starting from installing a package on a server to even restarting a service, be it any kind of local or remote task. Ansible will do it for you seamlessly.
A single bash script would be great if you have to manage and configure a single system, you are the single user and yours is a single machine. But when you scale up across more number of computers, multiple tasks, more users and more admins, you will discover that the bash scripts are not enough and efficient. This exactly where Ansible comes into the picture. Ansible can be treated as nurtured bash or shell scripting that can configure your huge infrastructure topology in one go.
Plus, Ansible uses a very simple language called YAML (YAML Ain’t Markup Language) in the form of Ansible playbooks that allows you to describe your automation task in a way that is as good as colloquial language.
The architecture of Ansible Free
Ansible is basically written in Python language. Ansible connects to your nodes and pushes small codes called “modules”. These programs are run against multiple nodes to reach the desired state. For example, an Ansible module might be asked to run a few sets of commands on a machine to install some package and at the end of the execution, check if the state of the package is installed. Ansible creates an SSH connection with the nodes, runs the modules and once execution is completed, it deletes those modules from the nodes. Your modules can reside on any node in the cluster.
Components of Ansible
- Master: This is the main machine that takes care of the configuration of machines with Ansible.
- Inventory: An inventory is a file that describes the nodes that are accessible by Ansible. The nodes can be grouped in the inventory file and named accordingly.
A typical inventory file would look like this –
The server names can be their DNS or IP Addresses.
- Playbook: YAML files that describe the automation tasks to be done by Ansible.
A typical playbook would look like this –
- name: install python
yum: name=python state=installed
- Task: This is the block that describes the action to be taken by Ansible in statements. Ex: Install httpd.
- Module: These are the executable plugins that do the task for us. There are many inbuilt modules which Ansible provides us. We can write our own custom-modules too.
- Role: An Ansible playbook can get really huge in size over time and maintaining it would be really tough. Hence with roles, one can group the tasks into subsets and manage the content efficiently. These roles (groups of tasks) can be reused accordingly.
- Play: Execution of a playbook is called a play.
- Facts: These are the global variables that will be referred across Ansible playbooks.
- Handlers: Used to invoke service status changes, like restarting or stopping a service or install or uninstall a package.
Advantages of Ansible Free
Following are the advantages of Ansible.
- Ansible manages the machines in an agentless You do not have to install any Ansible agents/service software on the client machine.
- Both push and pull of files/commands/codes are supported in Ansible.
- Ansible is a security-focused tool. And it uses OpenSSH as the secure transport protocol.
- Ansible scripts (popularly called as playbooks) are written in YAML and hence they are very easy to read.
- Ansible is The core idea here is that you only do things if they are needed and things that are repeated without side effects.
- If needed, then Ansible can easily connect with Kerberos, LDAP (Lightweight Directory Access Protocol) and other centralized authentication management systems.
- An advantage of higher order significance is that one need not be an expert in bash or shell scripting. Ansible has it handled by itself. So, the working becomes quite easy and straight forward with Ansible.
- One doesn’t really need to be a root user to run the Ansible playbook tasks on the nodes. It can acquire root privileges.
Why do we care about Ansible?
- Ansible is forming the core of DevOps tools.
- Ansible is minimal and simple to learn and to use as well. Michael DeHaan, the creator of Ansible said, “It is a kind of a tool you don’t use for 6 months and come back and you still remember.”
- Ansible follows a parallel task execution mechanism which makes it faster & better.
Ansible vs other Automation tools
Apart from Ansible, there are a lot of other configuration & management tools like Chef, Puppet, Salt, etc.
- Ansible uses a better option of a source control system for its source of truth, while other tools like Chef keep their own servers as a source of truth. By source of truth, I mean, the authoritative configuration.
- Ansible focuses more on orchestration than management.
- Unlike other tools, Ansible makes use of both dynamic and static inventories of host systems.
Starting with Ansible
- You can get started by referring the Ansible documentation here.
- You can find all the community playbooks from Ansible Galaxy.
- You can find some good videos here.
Conclusion – Is Ansible Free?
As they say it, “The best things in this world are for free”. Ansible, the best free and open source automation engine is something one must embrace whether one wants to automate his configuration & management or DevOps tasks.
This has been a guide to Is Ansible Free? Here we discussed its components, advantages, and Architecture. You can also go through our other suggested articles to learn more –