From the course: Learning Ansible

An introduction to Ansible - Ansible Tutorial

From the course: Learning Ansible

Start my 1-month free trial

An introduction to Ansible

- [Instructor] If you work in or around information technology, chances are, you've heard about Ansible lately. It seems to be the tool that everyone wants to use, and everyone is all excited about. But why is that? Well, Ansible is extremely simple, extremely easy to use and very flexible as we're going to find out in this course, but at its most simple, it's a task execution engine. So we're going to have Ansible running on a variety of different systems potentially, but oftentimes we are running it on a Linux system and Ansible can reach out and execute tasks on the local system that you're on and on remote systems. By the way, when you're running Ansible on a system, in order to control other systems, you tend to call that local system running Ansible, your control node. So you might hear me say control node when I'm referring to the Ansible system itself. In addition to this simplicity, there is a client lists architecture that Ansible uses. This is also wonderful. So when you want to control a bunch of systems using Ansible, you don't have to go to those remote systems and install client software. Instead, Ansible will use the kind of ubiquitous secure shell SSH. It will use SSH in order to make connections into those remote systems. And it will do its configuration magic for you. Of course it is upon you as the administrator to set up the SSH so that it functions properly between Ansible and those remote nodes. Everything that we do in Ansible is going to be in very human readable text files. So that really adds to the simplicity of utilizing Ansible. And the Ansible itself is written in the very popular Python programming language and the playbooks that we are going to be running, which can really get sophisticated and allow you to do automation and orchestration of tasks. Those are written in the standards based YAML, which is yet another markup language. YAML is very easy to read, very easy to work with. And that's yet another reason why Ansible is so celebrated. Finally, keep in mind that you could have massive fleets of servers these days. And Ansible is going to be a very effective way in which to really maintain and monitor and operate those massive fleets of systems. If you have a large, large enterprise and you have many, many different Ansible servers, and you have many, many systems that you manage, you may want help with managing Ansible itself and a nice web based graphical user interface for doing that is called Red Hat Ansible Tower. Now that is not a free product from Red Hat. So if you're interested in open source software for the management of all of your Ansible systems in a graphical user interface, you would want to check out the AWX product offering. So that's the open source version of Red Hat Ansible Tower, if you will. So let's take a look at Ansible in action shall we? Here you can see, I am logged in to a Linux server and this is my control node. I have Ansible set up on this system. So I'm going to run what's called an ad hoc command. And we'll talk more about these in great depth later on, but for right now, I'm just going to say, I want Ansible. So I call the Ansible executable. I want Ansible to run here against a list of systems that I have called my servers. So I say Ansible, my servers. And then I'm going to use a module called ping. The packet Internet Groper is very useful for reaching out and testing the availability of systems, and I've set this up so that it will test for the availability of my local host, the control node itself. And it will be checking for our remote servers and I've got one remote server out there at this point that we are going to be working with. So you can see how amazingly simple this is. Ansible, my servers, and then I call the ping module. We will see the results of this test, right at the command line. You can see that I successfully was able to ping communicate with over TCP IP, the system at 10 zero one, one 84 and also the system at 10 zero one 79. So we've got two systems that responded in my list of my servers and they're perfectly healthy and ready to communicate with us. And by the way, while it was a very simple little demonstration of Ansible notice how useful this was. You know, if you had dozens of servers to test for their reachability would be a real chore if you were manually inputting all of those different ping commands. So even our little simple demonstration here does really depict just how powerful Ansible is going to be for us.

Contents