Development mode — payments are simulated and emails go to the Dev Mailbox · Payment simulator
DDSP
Cover Ansible Automation — page spread 1 Ansible Automation — page spread 2 Ansible Automation — page spread 3 Ansible Automation — page spread 4 Ansible Automation — page spread 5 Ansible Automation — page spread 6 Ansible Automation — page spread 7 Ansible Automation — sample page Ansible Automation — sample page Ansible Automation — sample page

Learn Ansible from zero and automate a complete three-tier web platform: control node and lab setup, inventories, ad hoc commands, playbooks, variables and facts, Jinja2 templates, conditionals, loops, handlers, error handling, roles for nginx, PostgreSQL, and a Python app, collections and Galaxy…

Configure Servers, Deploy Applications, and Manage Infrastructure the Repeatable Way

Read before you buy: the PDF here is a free sample — the first 20 pages of the 478-page book (payments, sales and reviews on this demo site are sample data). Get the full e-book at thenexbooks on Gumroad.

Stop configuring servers by hand. Describe them once, and build them the same way every time.

Most server problems start with a small change made over SSH: a package installed to fix an urgent bug, a config file edited on one web server but not the other, a setting copied from an outdated wiki page. Over time, staging stops resembling production, nobody can rebuild a server with confidence, and deployments live in one person's head. Ansible replaces that with plain, readable YAML files that describe the state you want. It connects over SSH, changes only what differs, and lets the same code configure every environment.

This book teaches Ansible from the very beginning and takes you all the way to a production-quality automation project. You build one real platform step by step, and each feature appears at the moment it solves a problem you actually have — so you learn how to design automation for your own systems, not just memorize modules.

What's inside

  • How Ansible works — control node, managed nodes, inventory, modules, and playbooks — and how it compares fairly with shell scripts, Terraform, and other tools
  • Setting up a control node on Linux, macOS, or Windows with WSL 2, plus a four-server lab you can build yourself
  • Inventories for staging and production, groups, host and group variables, and ad hoc commands with essential modules
  • Playbooks done right: idempotency, check and diff mode, variables, facts, precedence, Jinja2 templates, filters, conditionals, loops, and handlers
  • Deliberate error handling with blocks, rescue, assertions, and health checks, and organizing automation with imports, includes, and tags
  • Roles for a real three-tier app: an nginx web tier, a PostgreSQL database tier, and a Python application under Gunicorn and systemd
  • Collections, Ansible Galaxy, and packaging your own roles as a collection
  • Security: Ansible Vault and secret rotation, users and SSH hardening, firewalls, TLS certificates, and guardrails that keep production safe
  • Dynamic inventory for cloud hosts and the hand-off between provisioning and configuration
  • Deployments with versioned releases, migrations, health checks, and one-command rollbacks
  • Rolling updates that drain servers from the load balancer, rolling patching with reboots, and automated database backups
  • Performance tuning, linting, Molecule tests, CI/CD pipelines, execution environments, debugging techniques, and writing custom filters and modules

One running example, start to finish. You automate the infrastructure of Brightloom, a fictional SaaS company whose invoicing app runs on two nginx web servers, one application server, and one PostgreSQL database, in separate staging and production environments. It starts as hand-configured servers that have drifted apart and becomes a single Git repository that builds any environment from scratch, deploys and rolls back releases, patches and backs up servers, and is tested automatically on every change.

Current and honest. The book targets recent versions of ansible-core with Ubuntu Server 24.04 LTS managed nodes, uses fully qualified module names throughout, and notes where Red Hat family systems differ. It is clear that the Ansible control node runs on Linux, macOS, or WSL — not natively on Windows. Command output is shown as what you should see something like, because versions and spacing vary. It contains no invented benchmarks or statistics. Every chapter includes step-by-step instructions, complete YAML and templates, Tips, Notes, Warnings, Try It Yourself exercises, and Key Takeaways, and the appendices give you a cheat sheet, templates and reference files, a production checklist, and a glossary.

Format: PDF, 478 pages (A4), linked table of contents and bookmarks. English. First Edition, 2026. Published by thenexbooks. Ansible is a trademark of Red Hat, Inc. This book is independent and is not affiliated with, sponsored by, or endorsed by Red Hat, Inc.

Table of Contents

Part I — Foundations

  • Ch 1 · Why Ansible: Automation the Repeatable Way
  • Ch 2 · Setting Up Your Control Node and Lab
  • Ch 3 · Inventories: Hosts, Groups, and Environments
  • Ch 4 · Ad Hoc Commands and Essential Modules
  • Ch 5 · Your First Playbook: Plays, Tasks, and Idempotency

Part II — Writing Playbooks

  • Ch 6 · Variables, Facts, and Precedence
  • Ch 7 · Jinja2 Templates and Filters
  • Ch 8 · Conditionals, Loops, and Handlers
  • Ch 9 · Error Handling, Blocks, and Task Control
  • Ch 10 · Organizing Playbooks: Imports, Includes, and Tags

Part III — Roles and Reuse

  • Ch 11 · Roles: Structure, Defaults, and Your First Role
  • Ch 12 · The Web Tier: Building the nginx Role
  • Ch 13 · The Database Tier: Building the PostgreSQL Role
  • Ch 14 · The App Tier: Building the Application Role
  • Ch 15 · Collections, Ansible Galaxy, and Dependencies

Part IV — Secrets, Security, and Environments

  • Ch 16 · Ansible Vault and Secrets Management
  • Ch 17 · Users, SSH, and Server Hardening
  • Ch 18 · Firewalls, TLS, and Network Security
  • Ch 19 · Managing Staging and Production Safely
  • Ch 20 · Dynamic Inventory and Cloud Hosts

Part V — Deploying and Operating

  • Ch 21 · Deploying Applications: Releases, Symlinks, and Rollbacks
  • Ch 22 · Rolling Updates and Zero-Downtime Changes
  • Ch 23 · Day-2 Operations: Patching, Backups, and Maintenance
  • Ch 24 · Performance and Scale: Forks, Strategies, Async, and Caching

Part VI — Quality and Production

  • Ch 25 · Testing Ansible: Linting, Check Mode, and Molecule
  • Ch 26 · CI/CD for Ansible: Pipelines, Execution Environments, and Navigator
  • Ch 27 · Debugging and Extending Ansible: Troubleshooting, Filters, and Modules
  • Ch 28 · Production Case Study: The Complete Brightloom Platform

Appendices
A · Ansible Cheat Sheet
B · Templates and Reference
C · Production Checklist
D · Glossary

Book details

Detail
Pages478
FormatPDF (A4)
LanguageEnglish
LevelBeginner to Intermediate
Edition1st Edition (2026)
Download on this siteFree sample, first 20 pages (PDF)
Publisherthenexbooks

Files you get

PDF
Ansible-Automation-Free-Sample.pdf
591.3 KB · version 1 · updated 28 Sep 2026

No reviews yet. Only buyers can review.

More from thenexbooks

Visit store
$9.00