What is Ansible used for and what does it do?
Ansible is an open source automation platform which was purchased by Red Hat in October 2015. It is used heavily by the server admin community for application deployment and to administer and deploy updates and patches to Linux servers.
In the last few years it has gained a great following from the network community who are now using it to administer and automate network operations across a wide variety of platforms.
Ansible works by connecting to nodes using SSH, pushing a desired state configuration and dis-connecting. Ansible is agentless.
|Purchased by:||RedHat in 2015 and IBM in 2022|
Is Ansible Free?
YES! Ansible is Free. As an open source software it is free to use and can be downloaded and installed from a number of sources, it will currently only run on a Linux or Mac that has Python installed.
It will not run directly on Windows.
However you could install WSL2 (Windows Subsystem for Linux) and run Ansible on that.
Ansible Free vs Paid
Whilst Ansible Core is Free to use if you want enterprise level support you can purchase a licensed product called Ansible Automation Platform from Red Hat which is what most enterprises use. The free version of Ansible is CLI based only but still give you a very functional tool for automation. There is also another version of software called Ansible AWX which is the upstream version of Ansible Tower which has now been replaced by Ansible Automation Platform (AAP)
Introduction to Ansible, what does Ansible do?
Ansible is one of the most popular Devops tools in use today, saving you time performing repeatable tasks. Originally used for Linux servers and web services, but now gaining a massive following in the network automation community.
Is Ansible open source?
Yes, Ansible is open source which means you can download Ansible for free and fully view the source code.
Is Ansible free for commercial use?
What is Ansible used for? A lot of companies use the free version of Ansible for all their automation requirements, however with the free model you do not get any support. If you have technical teams who can support it then a lot of people choose to use it, however if you want a bit more assurance that the platform that is automating your infrastructure is supported you can purchase a product called Ansible Tower
If you want to move into a supported model you need to look at Red Hat Ansible Automation Platform. You can license your nodes and get support and certified collections from Red Hat.
Ansible Engine a version of Ansible with full support from Red Hat and also Ansible Tower a GUI front end to drive Ansible core Ansible Tower is licensed on a per node basis.
But if you just want to download Ansible and use it for your home or production use – it is free to use.
What is Ansible pricing? – https://www.ansible.com/products/pricing
Ansible Architecture Diagram
The architecture of Ansible is very simple, it consists of an Automation Engine, which is typically an install on a Linux host i.e Ubuntu, then then input into that Engine via a user in the form of a Playbook. You can also optionally have input from an external source i.e Github. Then the output is an SSH connection to the hosts you want to configure. Ansible is written in Python but you do not need to know Python to use it.
All you need to run Ansible is your favourite terminal, some configuration files and maybe a version control system.
If you are a network engineer check out my Ansible Training Course for Network Engineers
What is Ansible Inventory?
The Ansible inventory is a list of hosts / devices that you want to automation. The file can be static or dynamic and in INI or JSON format. For more information you can read more on my post entitled Ansible Inventory File !
In order for Ansible to connect to a device and perform a function a module is used which is essentially a block of code written by a vendor enabling connecting and configuration to be performed on their device. Ansible ships with some built in modules and then you install the vendor specific modules via Ansible Galaxy.
What is Ansible Galaxy?
What is an Ansible Playbook used for?
Ansible Playbooks are written in YAML. The playbook tells Ansible what to automate. It is also a human readable file that contains a list of simple actions to perform when automating server or network tasks.
A playbook defines what you want Ansible to do, it references what Ansible modules to use and it is the Ansible modules that perform the task. Ansible modules can be written in any language that can return JSON but most of them are written in Python.
An example of an Ansible Playbook to configure a Nexus Switch is shown below
Note: hosts: references the group of devices that Ansible is going to automate all this information is stored in the Ansible Inventory file
--- - hosts: NEX-9K-Leaf-1 gather_facts: false connection: local tasks: - name: Configure RID Loopback Lo0 nxos_config: lines: - description "Configured by Ansible" - ip address 18.104.22.168/32 parents: interface loopback0 - name: Configure VTEP Loopback Lo1 nxos_config: lines: - description "Configured by Ansible" - ip address 100.100.100.2/32 parents: interface loopback1
Is Ansible owned by Red Hat?
Ansible was purchased by Red Hat in October 2015 but more recently Red Hat has been acquired by IBM. Ansible has still retained the Ansible by Red Hat name.
What is Ansible Tower used for?
Ansible Tower is basically a GUI front end for Ansible, but it is much more than that.
- Role based access to allow certain users to run only specific tasks
- It hides credentials from certain users running playbooks
- Full logging of all playbook runs and output
- Scheduling of tasks
- Rest API functionality
- Tower dashboard giving you visibility of job runs / success/ failures
Is Ansible Tower Free?
Ansible Tower (now included with Ansible Automation Platform) is free to use for up to 10 devices, however Ansible Tower is really a paid tool if you want to manage a network of any size.
Note: Ansible Tower has now been replaced with Ansible Automation Platform this is an enterprise wide automation platform that provides all the previous features of Tower with a lot more built in.
Ansible tower is now included within Ansible Automation Platform. Ansible Automation Platform is now the default enterprise wide automation platform and whilst you can still get Tower, most new deployments will use Ansible Automation Platform
Please read my guide on Ansible Automation Platform for more information
What is Ansible Automation Platform
Red Hat Ansible Automation Platform is Red Hat’s enterprise automation platform that includes everything needed to build, deploy, and manage end-to-end automation at scale. Ansible Automation is a fully-supported platform built around Ansible Core to ensure a consistent Ansible experience. Ansible Automation Platform makes it possible for users across an organization to create, test, and manage automation content through a powerful and agentless framework. It is a more secure, stable, and flexible foundation for deploying end-to-end automation solutions, from IT processes, to hybrid cloud, to the edge.
If you are looking for free, keep reading.
What is Ansible AWX?
Ansible AWX is the open source upstream project for Tower. It is free to use and contains all the latest code and updates. However it is not supported by RedHat. If you want try out Tower for free then look at AWX.
If you want a fully supported enterprise automation platform then you should be looking at Tower.
There are many other open source network automation tools available that do similar jobs and to which Ansible is often compared to but they are all different and are suitable for different jobs. The list below shows some of the common comparisons
Ansible vs Jenkins
Ansible is not really a replacement for Jenkins it is actually a product you would use alongside Jenkins.
Jenkins is more of a continous pipeline engine
Ansible vs Docker
Ansible and Docker are two completely different things, I am not sure why the are often compared, but Docker is a container platform used to run multiple hosts (containers) on a single platform.
Ansible vs Puppet vs Chef
The closest comparison to Ansible are other two main automation tools, Puppet & Chef. Whilst they do a lot of things the same the main advantage that Ansible has over both these tools is that it is Agentless, so only requires an SSH connection to the target device.
Puppet & Chef require an agent to be installed on the target device. Whilst this is fine for server administration it does not work for most network hardware, which is why Ansible is fast becoming the network automation tool of choice for network engineers.
Ansible Configuration Management
Ansible Network Modules
What is Red Hat Ansible Automation Platform?
Ansible Automation Platform is the new offering from Red Hat which gives you a suite of tools to assist with your automation over and above what was previously available in just Tower.
More info here – Ansible Tower vs Ansible Automation Platform
Which network protocol does Ansible use by default to communicate with managed nodes?
By default Ansible uses SSH to communicate with managed nodes. For most network devices this is perfect, you might have some devices that will only have telnet enabled, you will have to upgrade these devices to support SSH.
Ansible can also use https / API for connectivity
If you were looking for the answer to “What is Ansible?” I hope this answered the question for you.
How do I learn Ansible?
If you are just starting on your automation journey and want to improve your Ansible skills, check out my course.
The average salary of a developer with Ansible skills is $110,000 per year, and some developers earn even more. According to Dice
Ansible for Network Engineers
Ansible is a great tool for configuration management for network devices which makes it a great tool for network engineers. There is a great support community and a host of questions and answers on stack overflow!
So take action today and start to learn Ansible and start using software to automate your network infrastructure.
If you really want to learn Ansible the very best place to go is the official Ansible documentation, which can be found here: https://docs.ansible.com/
Ansible for Configuration Management
Ansible is a great tool for configuration management, especially for network devices. you can read more at some other posts below.
Ansible for Network Automation
Originally developed as a tool for Linux server automation Ansible is now one of the most popular open source network automation tools.
Ansible for Infrastructure Orchestration
Ansible by Red Hat can be used for Network Automation, Orchestration, Configuration Management, Cloud and Server Automation and is Open Source.
Other Ansible posts:
- Ansible vs Python
- What is Ansible Vault?
- Ansible Tutorial to Backup a Cisco IOS Router Configuration
- Ansible Hosts File
- Ansible Training
- Ansible Automation Platform 2
Ansible Frequently asked Questions
Can Ansible run on Windows?
The short answer is no. Ansible will only run on a linux based system, however if you want to run Ansible on Windows you can look to install the Windows subsystem for Linux or run a Virtual machine on your Windows device.
What is Ansible used for?
What is Ansible used for is a very common question. Ansible is an IT automation engine that allows you to automate provisioning and operation of cloud, server and network devices. It can handle config management, application deployment and orchestration. It is free to use as it’s open source. There is also a version called Ansible Tower which gives you a GUI and more security features and is a paid version that comes with support.
What is the difference between Ansible and Python?
Ansible is an IT automation framework, whilst Python is a programming language. Ansible is written in Python. You can use Ansible or Python or both to automate your IT infrastructure but Ansible is seen as the easiest to get started with. However, if you are serious about network automation then Python is where you really need to focus your skills.
Is in Ansible written in Python?
Yes! Ansible is an IT automation platform that is written in Python. To operate Ansible you do not need to know any Python as all the playbooks are written in YAML. You can integrate Python scripts into your playbooks or write your own Python scripts and make your own Ansible modules.
Is Ansible Tower free?
No, Ansible Tower is a paid version of software from RedHat which provides you a GUI, enhanced security and enterprise level support. If you want to use Tower features you can install Ansible AWX which is the open source upstream version of the Tower product.
What is Ansible Galaxy?
What is Ansible Galaxy is a very common question. Ansible Galaxy is an online repository where you can download Ansible roles. It can be found at https://galaxy.ansible.com/
What is Ansible Vault?
What is Ansible vault is a very common question. Ansible Vault is a feature within Ansible that allows you to encrypt secure information like credentials and passwords. This allows you to store sensitive information in encrypted files rather than plain text. On playbook runs the files are un-encrypted with the secret key which can be entered on the playbook run or stored in a secure location. Check out my Ansible Vault Tutorial for more information.
Which network protocol does Ansible use by default to communicate with managed nodes
The default connection method for Ansible to managed nodes is SSH, or CLI over SSH, it can also use XML over SSH and API over http/https. You cannot use Telnet