From the course: Learning Ansible

Ansible ease of use - Ansible Tutorial

From the course: Learning Ansible

Start my 1-month free trial

Ansible ease of use

- [Instructor] It can be pretty hard to believe that something so incredibly powerful, like Ansible could be so easy to use, but I think we have to remember the original goals of Ansible and they were to be clear, to be fast, to be complete, to be efficient and to be secure. So the initial goals of the product really help to drive this ease of use and the simplicity. Now another goal of Ansible was that we could go up to someone using Ansible, and we could say things like, show me the playbook that you're using. And we could read that, it would be human readable. And we might say, show me your inventory file. And it's very easy to read. We can just look at what someone is doing with the product, and we can immediately understand what they are trying to accomplish. Now, one of the amazing things about Ansible to me is that even though it is so simple, even though it is so straightforward, it can be utilized in large environments. In fact, one could argue that if you had a massive enterprise, you could call upon something like Red Hat Tower to manage the overall Ansible deployments you've got throughout the enterprise, and really this product could scale to the very largest of enterprises. Now really attributing to this ease of use concept is the fact that Ansible is going to leverage modules in its operation. And we'll take a close look at these, but they really give Ansible their straightforward functionality to do different things. For example, if we want to quickly test for the reachability of some node on the network, we can call upon the ping module. If we want to write information to a file, there's going to be a module for that. And this lends itself to the extensibility of Ansible, where it can just continue to evolve as technologies change. And speaking of extending Ansible's functionality, there's plugins for Ansible. So Ansible is going to have its own versioning where new features and efficiencies are added, but there's plugins that we can add to give additional functionality. A great example of this is when we want to have our inventory, the listing of hosts that we're going to be managing updated dynamically from something like AWS, a plugin gives us that functionality. And speaking of inventories, we have these simple inventories that we use to list the devices that we're going to be managing. And these inventories we can statically create, but thanks to plugins, we can have them dynamically generated as I described, so inventories and their simplicity is a great example of just how the overall approach to Ansible was so straightforward. Now to prove this to you, here is an inventory file. And notice the file by default is named hosts. And you can see that I have in brackets here, web servers, and then I've got two fully qualified domain names that I'm pretending are my web servers. You can put in an IP address. If you don't have the fully qualified domain name for the resource, notice you can use regular expression type syntax in order to give a range of matching. And here you can see, I have the DB servers, the database servers, and I've got a couple of sample entries here. So this just really gives us a sense for how incredibly easy this product is going to be to work with. There's the devices that we can control in two different categories. And of course, we can call these by this simple name when we are in a playbook and we want to enact some behaviors against those devices, couldn't be any easier. This is a good old text file that is so easy to read and understand, and yet it is critical to the functionality of Ansible.

Contents