What is Ansible?

What is Ansible? Ansible is an open-source IT automation engine, which can remove drudgery from your work life, and will also dramatically improve the scalability, consistency, and reliability of your IT environment. We’ll start to explore how to automate repetitive system administration tasks using Ansible, and if you want to learn more, you can go much deeper into how to use Ansible with Cloud Academy’s new Introduction to Ansible learning path.

What is Ansible and what can it automate?

You can use Ansible to automate three types of tasks:

  • Provisioning: Set up the various servers you need in your infrastructure.
  • Configuration management: Change the configuration of an application, OS, or device; start and stop services; install or update applications; implement a security policy; or perform a wide variety of other configuration tasks.
  • Application deployment: Make DevOps easier by automating the deployment of internally developed applications to your production systems.

Ansible can automate IT environments whether they are hosted on traditional bare metal servers, virtualization platforms, or in the cloud. It can also automate the configuration of a wide range of systems and devices such as databases, storage devices, networks, firewalls, and many others.

The best part is that you don’t even need to know the commands used to accomplish a particular task. You just need to specify what state you want the system to be in and Ansible will take care of it. For example, to ensure that your web servers are running the latest version of Apache, you could use a playbook similar to the following and Ansible would handle the details.

---
- hosts: webservers
  vars:
    http_port: 80
    max_clients: 200
  remote_user: root
  tasks:
  - name: ensure apache is at the latest version
    yum: name=httpd state=latest
  - name: write the apache config file
    template: src=/srv/httpd.j2 dest=/etc/httpd.conf
    notify:
    - restart apache
  - name: ensure apache is running (and enable it at boot)
    service: name=httpd state=started enabled=yes
  handlers:
    - name: restart apache
      service: name=httpd state=restarted

The line in the above playbook that actually installs or updates Apache is “yum: name=httpd state=latest”. You just specify the name of the software package (httpd) and the desired state (latest) and Ansible does the rest. The other tasks in the playbook update the Apache config file, restart Apache, and enablea Apache to run at boot time. Take a read at one of our previous blog posts on how to build Ansible playbooks.

Why Ansible?

There are many other IT automation tools available, including more mature ones like Puppet and Chef, so why would you choose Ansible? The main reason is simplicity. Michael DeHaan, the creator of Ansible, already had a lot of experience with other configuration management tools when he decided to develop a new one. He said that he wanted “a tool that you could not use for six months, come back to, and still remember.”

DeHaan accomplished this by using YAML, a simple configuration language. Puppet and Chef, on the other hand, use Ruby, which is more difficult to learn. This makes Ansible especially appealing to system administrators.

DeHaan also simplified Ansible deployment by making it agentless. That is, instead of having to install an agent on every system you want to manage (as you have to do with Puppet and Chef), Ansible just requires that systems have Python (on Linux servers) or PowerShell (on Windows servers) and SSH.

What is Ansible? A New Learning Path

Although Ansible is easier to learn than many of the other IT automation engines, you still need to learn a lot before you can start using it. To help you with this, Cloud Academy has released its Introduction to Ansible learning path.

This learning path includes three video courses:

  • What is Configuration Management?: A high-level overview of configuration management concepts and software options.
  • Getting Started With Ansible: Covers everything from Ansible components to writing and debugging playbooks in YAML.
  • Introduction to Managing Ansible Infrastructure: An overview of Ansible Tower (Red Hat’s proprietary management add-on to Ansible) and Ansible Galaxy (a place to find and share Ansible content).

Hands-on practice is critical when learning a new technology, so we have included two labs in the learning path:

Finally, you can test your knowledge of Ansible by taking the quizzes.

Watch this short video, taken from the Getting Started with Ansible Course, where we take a look at the most common Ansible use cases.

Conclusion

Whether you need to make your life easier by automating your administration tasks or you’re interested in becoming a DevOps professional, Ansible is a good place to start. Learn how to streamline your IT operations with Introduction to Ansible.
Introduction to Ansible

 

Avatar

Written by

Guy Hummel

Guy is a certified cloud architect on all three of the major public cloud platforms: AWS, Azure, and Google Cloud Platform. He launched his first training website in 1995 and he's been helping people learn IT technologies ever since. Guy’s passion is making complex technology easy to understand.


Related Posts

Avatar
Adam Hawkins
— July 9, 2019

Top 20 Open Source Tools for DevOps Success

Open source tools perform a very specific task, and the source code is openly published for use or modification free of charge. I've written about DevOps multiple times on this blog. I reiterate the point that DevOps is not about specific tools. It's a philosophy for building and improv...

Read more
  • Ansible
  • Chef
  • configuration management
  • DevOps
  • devops tools
  • Docker
  • infrastructure-as-code
  • Kubernetes
  • telemetry
Stefano Bellasio
Stefano Bellasio
— July 7, 2016

4 New Webinars for July 2016: Ansible, AWS Lambda, A/B Testing Algorithms in the Cloud, and Office Hours

Hello! This is Stefano. It's been a while since my last post on our blog. I've been busy working with our great team at Cloud Academy, but I would like to use this article today to talk about something we've been really enjoying these last few months: doing cloud training webinars with ...

Read more
  • Ansible
  • AWS
Avatar
Maxime Thoonsen
— March 3, 2016

Deploy Web Applications on IaaS with Ansible

This article explains how to easily deploy a web application on IaaS platforms using Ansible. We'll see the big picture and then study the case of deploying a Symfony application. What is Ansible? Ansible is an automation framework written in Python. An Ansible script is basically a l...

Read more
  • Ansible
  • AWS
Avatar
Chandan Patra
— October 21, 2015

Ansible and AWS: Cloud IT Automation Management

With things moving a bit more slowly through the holiday season, we’re going to re-run some of our most popular posts from 2015. Enjoy! The kinds of virtual infrastructures that define the cloud computing ecosystem demand a high level of automation. As the number of virtual servers use...

Read more
  • Ansible
  • AWS
  • Azure
Avatar
Sanket Dangi
— January 27, 2015

Building Ansible Playbooks Step-by-Step

Update 2019: We've recently developed a Learning Path, Introduction to Ansible, which will help you to get you started using Ansible to automate common IT tasks, you will learn about Configuration Management and you'll be able to practice your knowledge on Ansible through a series of ha...

Read more
  • Ansible
Avatar
David Clinton
— January 26, 2015

Cloud Technology and Security Alert News Digest – Issue #10

Update 2019: We've been busy working on some great training content around security, check out the Cloud Academy library to prepare on all-things cloud security. Welcome to the Cloud Technology and Security Alert News Digest. This week we've got word of some big platform changes ...

Read more
  • Ansible
  • Azure
  • Chef
  • Containers
  • Security
Avatar
Sanket Dangi
— January 12, 2015

Going Deeper into Ansible Playbooks

Update 2019: We've recently developed a Learning Path, Introduction to Ansible, which will help you to get you started using Ansible to automate common IT tasks, you will learn about Configuration Management and you'll be able to practice your knowledge on Ansible through a series of ha...

Read more
  • Ansible
  • Cloud Computing
Avatar
Sanket Dangi
— December 29, 2014

Get Started with Ansible on the Cloud

Update 2019: We've recently developed a Learning Path, Introduction to Ansible, which will help you to get you started using Ansible to automate common IT tasks, you will learn about Configuration Management and you'll be able to practice your knowledge on Ansible through a series of ha...

Read more
  • Ansible
  • AWS