Leanpub Header

Skip to main content

Learning Ansible, Second Edition

Automate Modern IT Operations for Linux, Windows, Cloud and Kubernetes using ansible-core, Event-Driven Remediation, AI Agents and MCP

Learning Ansible, Second Edition
This book is 100% completeLast updated on 2026-10-28

In this 2nd edition, I'm going to be working with you on a single app called OrderDesk. We'll build its inventory, roles and secrets, and then we'll patch its servers, provision its cloud resources and deploy it to Kubernetes. Later, we'll watch it with Prometheus, heal it with Event-Driven Ansible and diagnose its failures with playbooks that collect evidence in seconds. Then, in the last few chapters, we'll start inviting AI agents through tools and MCP servers, while approvals and check mode make sure that everyone keeps control of the decisions. You don't need to be a pro programmer to follow along.

Minimum price

$29.99

$29.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
1 Previous Editionwith 25 Readers
New edition of Learning Ansible
About

About

About the Book

There are thousands of reliable systems out there, and Ansible is the unsung hero that makes sure all your IT work is done on time and can be reviewed easily. This second edition shows you exactly the proven and usable, tried-and-tested ansible techniques that will help you bring stability to your own operation. It is a hands-on absolutely, built on Ansible-Core 2.21, where you'll set up a clean control node, write reusable roles, protect secrets and test each change before it reaches a server. Next, you'll be patching Linux and Windows fleets, provisioning AWS and Azure resources using Terraform, deploying to Kubernetes and OpenShift, and sharing automation safely through Ansible Automation Platform.

In the later chapters, it's all about production. You'll build monitoring with Prometheus and Grafana, fix familiar failures automatically with Event-Driven Ansible, and diagnose CPU, memory, database and network faults with ready-to-run playbooks. At last, you'll be able to hook up AI agents and MCP servers to Ansible. Every single chapter is making a strong effort to focus on practical, hands-on techniques, so you can put each one into practice right away.

Key Learnings
  • Build version-pinned control node with execution environments and ansible-navigator.
  • Write reusable roles and collections with argument specs, handlers and failure handling.
  • Protect secrets with Ansible Vault and HashiCorp Vault.
  • Patch Linux and Windows fleets through rolling updates.
  • Provision AWS and Azure resources while dividing work cleanly between Terraform and Ansible.
  • Deploy, verify and roll back containerized releases on Kubernetes and OpenShift using Helm.
  • Scale team automation with Automation Platform workflows, surveys, approval gates and RBAC.
  • Auto-remediate full disks, crashed services and expiring certificates with Event-Driven Ansible rulebooks.
  • Diagnose CPU, memory, database and network faults, then open ServiceNow incidents automatically.
  • Connect AI agents and MCP servers to Ansible with approvals, allowlists and scoped credentials.

Table of Content
  1. Getting Started with Modern Ansible
  2. Building Reusable Playbooks and Roles
  3. Securing and Testing Automation
  4. Managing Linux and Windows Fleets
  5. Provisioning Cloud Infrastructure with Terraform and Ansible
  6. Automating Containers and Kubernetes on OpenShift
  7. Scaling with Ansible Automation Platform
  8. Building Observability
  9. Auto-Remediating with Event-Driven Ansible
  10. Diagnosing and Resolving Production Issues
  11. Building AI Agents for Ansible Operations
  12. Connecting Ansible to Tools using MCP

Author

About the Author

GitforGits | Asian Publishing House

We are the engineer’s publisher, the coder’s mentor, and the content alchemist—meticulously turning dense tech into practical gold. With a growing library of 100+ titles, we don’t just develop technical books, rather we build roadmaps for professionals across Python, MySQL, DevOps, Rust, AI, Kotlin, Arduino, Golang and everything around the massive IT ecosystem. Every chapter, every script, every project is a tool in the hands of developers who want to get things done.

Where others summarize, we construct step-by-step learning blueprints, cutting through clutter, banning the fluff, and ensuring every paragraph delivers hands-on value. Our audience isn’t learning from scratch—they’re leveling up with purpose, and we stand by them with code-first content, consistent project workflows, and a zero-redundancy approach.

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub