6.1 Ansible Overview
Ansible is an open-source software provisioning, configuration management, and application-deployment tool enabling infrastructure as code. It runs on many Unix-like systems, and can configure both Unix-like systems as well as Microsoft Windows.
6.2 Playbooks and Roles
Playbooks are Ansible's configuration, deployment, and orchestration language. They can describe a policy you want your remote systems to enforce, or a set of steps in a general IT process.
---
- name: Install Nginx
hosts: webservers
become: yes
tasks:
- name: Ensure Nginx is installed
apt:
name: nginx
state: present
6.3 Inventory Management
Ansible works against multiple managed nodes or "hosts" in your infrastructure at the same time, using a list or group of lists known as inventory.
6.4 Ansible Galaxy
Ansible Galaxy is a repository for Ansible Roles that are available to drop directly into your Playbooks to streamline your automation projects.
🎯 Practical Exercise
Create an Ansible playbook to install and configure a LAMP stack (Linux, Apache, MySQL, PHP) on a remote server.