Working with Ansible
In this section, we’ll use the Ansible CLI tools extensively to perform various configuration management tasks. To showcase our practical examples, we’ll work with a custom lab environment, and we highly encourage you to reproduce it for a complete configuration management experience.
Here’s a high-level outline of this section:
- Setting up the lab environment
- Configuring Ansible
- Using Ansible ad hoc commands
- Using Ansible playbooks
- Using templates with Jinja2
- Using Ansible roles
Let’s start with an overview of the lab environment.
Setting up the lab environment
Our lab uses Kernel-based Virtual Machine (KVM) as a hypervisor for the virtual environment, but any other hypervisor will do. Chapter 11, Working with Virtual Machines, describes the process of creating Linux virtual machines (VMs) in detail. We deployed the following VMs using Ubuntu Server LTS to mimic a real-world configuration management...