This course will show you how to get started with automation and orchestration using the open-source tool Ansible version 1.x. Many hands-on demos are included to show how to implement your automation tasks.
Automation and orchestration is becoming more common in the enterprise as departments continue to do "more with less." Ansible is an open-source automation tool for managing your configuration, provisioning, and change management. We start with orchestration and change management fundamentals then move to how Ansible works. After building our test environment, we then move to more practical examples and features that Ansible provides. By the end of the course, you will be able to run ad-hoc commands across all your systems, write playbooks, and create roles using the hundreds of modules that come with Ansible. While this course was recorded with Ansible v1.5, all commands should work up to 1.9, though some were deprecated in 1.8
Aaron has been in the IT industry for the last 16 years. During this time, he has worked in a wide range of technologies including desktop, web, server, messaging, virtualization, programming, and networking. He loves solving challenges using creative thinking and new technologies.
Section Introduction Transcripts
Section Introduction Transcripts
Introduction Hello and welcome to this training series from Pluralsight, Hands-on Ansible, where we're going to learn and get our hands dirty about system provisioning, change management, and automation using the open source software, Ansible. Throughout this course we'll be showing you the concepts and fundamentals of the software, along with real world examples and exercises on doing many server-related tasks. My name is Aaron Paxson, and in this module we'll be introducing Ansible, what it can do, and why you'd want to use it.
Architecture and Process Flow So before we start using Ansible, it's going to be helpful to know and understand the fundamental architecture underneath everything. Having a good foundation of these Ansible concepts will make you a better automation engineer, and it's going to give you those skills that you need to better integrate Ansible into your existing system environment. By knowing its strengths, and even its limitations, you can better plan for your implementation of Ansible. Sometimes even knowing what the limitations are, you can normally get around it by putting something else in. Ansible has been thoroughly thought out and tested using these architectures and processes. Some of it might be familiar to you, but some of it may not be. Up until now we've been using terms like tasks and actions, so in this module we're going to start using Ansible terms, like plays and playbooks. Let's get started with a look under the hood of Ansible's architecture and how it processes its own execution.
Ansible Inventory and Configuration Now that we have our environment and tested that Ansible is in fact working successfully, it's time to do some deep dives into Ansible's core framework. Now in this module we're going to be discussing the inventory component, as well as Ansible's configuration. We're going to be showing you some of the basic and advanced features that they provide. Now if you think that the inventory element is merely just a lookup file for Ansible, well then I'm going to encourage you to watch this module as we learn some of the cool aspects that this file can bring to your Ansible automation. We're also going to be showing you how to describe your environment using systems, groups, and then also assigning them variables. We're going to end with configuring Ansible for your environment.
Ansible Modules Ansible modules are the building blocks that make automation. They're the different actions that you can perform on systems. You can kind of think of them as like a script repository, each module is built for a specific task and you use parameters to change the behavior of that task. Now as of right now, there are 462 different modules that are included in the Ansible distribution, with more always being added, and countless others that are being developed by other companies and communities. Chances are, if you need it, it probably exists, and if it doesn't, and you have familiarity with programming in some kind of language, you can create your own, all Ansible really requires is just something that can be executed on the remote host, and sending JSON back to Ansible. In this course module we're going to be doing a deep dive into reviewing what modules are out there, pulling out some of the more common modules to use, and then at the end we're going to be using some of those modules.
Plays and Playbooks Playbooks are the most common way to execute your automation workflows. They bring together all of your plays to orchestrate whatever process that you're trying to execute. They're easy to use, but they can be incredibly powerful and extendable. I could probably take an entire course dedicated to playbooks, but unfortunately we just don't have the time to do that. Instead, I'm going to give you enough information to get a really good head start. We're going to be going over basic usage, error handling, and logic controls to give your playbooks enough power to kick start your journey with Ansible. We're going to go over a lot of information, and proving that information in our demos. So if you're ready, let's go ahead and get started.
Roles Roles allow you to refactor your playbooks into manageable and more identifiable categories. If you really think about your environment, you may not see a MySQL, Apache or LDAP server, you may see an application server, Active Directory, code building servers or maybe some business repositories. If you sit down and take a minute to think about it, you can probably start looking at your servers as participating in functions of a process. For example, instead of server1 being a MySQL server, you may see it as a dbserver, a datacenter server, and a managed server. You can think of roles as abstracted functions that a system is going to provide, tags if you will. Once you do that, you've identified the roles that that system participates in. In this module, I'm going to be showing you how you can create and use roles in your playbooks. It does take some work ahead of time, but you'll soon see that it's worth it in the long run. The more effort and time that you put into building your Ansible process, the more successful your automations are going to be.