
Learn the essentials of ansible through hands-on labs, starting with basics and advancing to playbooks, ad hoc commands, and deploying a fully functional multi-node lamp stack for configuration management.
Explore the course overview and lab setup for Ansible essentials, including a five-VM lab topology with Vagrant or Docker and a complete LAMP stack deployment.
Get to know Ansible's key components such as Ansible Controller, playbooks, modules, tasks etc.
Continually updated Text Document with Course FAQs.
Learn about the multiple methods to install Ansible. Install latest version of Ansible on a controller machine.
Learn about the Ansible inventory file. Create and customize an inventory file for deploying a 3-tier web application with Ansible.
Get familiar with the Ansible configuration file. Learn how to customize and use it in a multi-project environment.
Explore Ansible playbooks and YAML basics, including ad hoc tasks, handlers, loops, conditionals, variables, facts, and Jinja templating, while reviewing mappings, lists, dictionaries, quotes, and indentation.
Execute tasks in Ansible playbooks by calling modules to perform a unit of work on matched hosts, ensuring idempotency and item potency so repeated runs reach the desired state.
Learn how the ansible setup module gathers facts about remote hosts and supports OS-family based decisions. Apply these facts to choose the right package manager and Apache package in playbooks.
Start the Apache service with Ansible's service module by setting name and state to started. Enable it to boot automatically and verify it runs.
Use Ansible's copy module to deploy files to remote hosts with owner, group, and mode; leverage content or source files, backups, and idempotent updates for an Apache site.
Master using loops in ansible to copy multiple files with a single task, and adopt best practices for package management with yum or apt and php installation.
Learn the basics of ansible variables: naming rules, types like integers, booleans, lists, and dictionaries; declare and reference variables in playbooks with double braces, and loop over lists and dictionaries.
Develop and deploy an Ansible playbook using the lineinfile module to populate the /etc/hosts file across all lab VMs, enabling name resolution and smooth testing.
Learn to detect failures and continue playbooks by registering task results and using when conditions to revert bad configurations, debug messages, and remove invalid files so Apache restarts are safe.
Configure the firewalld module to allow port 80 and port 3306 across web servers, load balancer, and database, with curl tests and RAM considerations.
Explore how Ansible tags target specific tasks and blocks, run or skip tagged content, and use tag inheritance with list tasks and list tags to manage lamp stack playbooks.
Learn to modularize Ansible playbooks with includes, imports, and roles to create reusable task files. Compare static and dynamic behaviors and apply the dry principle.
Organize playbooks with ansible roles, a predefined directory structure, and a framework for variables, tasks, files, templates, and modules. Call roles within a play; they cannot be executed directly.
Discover the standard yaml-based Ansible role structure, with eight directories, and learn to create roles manually or via the ansible galaxy tool, preparing a web role for Apache installation.
Explore how to define and manage role variables in Ansible, comparing defaults and vars, understanding precedence, using namespace best practices, and migrating variables into role definitions.
Define and explore the meta/main.yml to manage Galaxy info and role dependencies, and observe how dependent roles run before the main web role in a test playbook.
Install and configure vagrant on your local machine using virtual box as the hypervisor. Set up a lab environment and verify the installation for hands-on practice.
This is the Vagrantfile I have used to set up the lab environment. It requires a little customization like folders etc and also you should remove the '.txt' file extension before running "vagrant init" command.
Ansible is a simple to understand, simple to adopt, simple to use IT configuration management and automation tool. With the Ansible Essentials course, you can start from the basics and go all the way to creating your own playbooks and roles with Ansible.
This is a focused course designed to rapidly get you up to speed on using Ansible automation engine in real life. As an IT professional, you'll develop a solid understanding of Ansible and will be able to apply it to daily automation and configuration management tasks.
Ansible Essentials course includes lots of examples and hands-on labs and aims at providing students with first-hand experience with course concepts. You can follow along the course by setting up your own lab environment. A Vagrant environment is used throughout the course, and in the appendix, you'll find detailed lectures showing you how to set up one for yourself.
Each lecture introduces a new Ansible concept. Concepts are first explained, and then relevant examples are provided. Some of them are also demoed in the lab environment showing you how they can be applied to playbooks. And finally, we apply the concept to our LAMP Stack playbooks.
Course follows a progressive path that mirrors a real-world approach to automation. It's divided into five sections, starting with the architectural overview and foundational concepts. In section 2, we'll install Ansible automation engine and learn about inventory, which is the first thing we need to get started automating tasks with Ansible. We'll learn ad-hoc commands and also discover some of Ansible's commonly used modules in section 3.
Then we'll move on to ansible playbooks. Playbooks let us use fully-fledged configuration management and orchestration capabilities of Ansible. Ansible playbooks are written in YAML, so before diving into the details of playbooks, we'll do a YAML overview. Then, we'll learn about playbook basics, including playbook structure, idempotency, and tasks. We'll learn how to run a playbook, check its syntax, and control its output with verbose.
Then we'll start building our 3 tier web application. In each lecture, we'll learn one or more ansible features, and we'll apply them to our project. In this part of the course, you'll learn about handlers, Jinja2 templating, loops, variables, error handling, and much more. At the end of this section, you'll have prepared playbooks that can deploy a fully functional multi-node LAMP stack on your machines.
In section 5, we'll cover how to organize playbooks more effectively where you'll learn about imports, includes, and roles. We'll refactor the playbooks into roles and make them easy to share and reuse.
This course is based on Red Hat® Ansible Engine 2.8 and CentOS Linux 7.7. By following along the course, you'll learn how to set up a 3-tiered web application environment that leverages Apache2, Python, and MySQL on CentOS machines.