Ansible Playbook Essentials

Want to download or buy Ansible Playbook Essentials?

Click to download from Amazon →

Design automation blueprints using Ansible’s playbooks to orchestrate and manage your multi-tier infrastructure About This Book Get to grips with Ansible’s features such as orchestration, automatic node discovery, and data encryption Create data-driven, modular and reusable automation code with Ansible roles, facts, variables, and templates A step-by-step approach to automating and managing system and application configurations effectively using Ansible’s playbooks Who This Book Is For If you are a systems or automation engineer who intends to automate common infrastructure tasks, deploy applications, and use orchestration to configure systems in a co-ordinated manner, then this book is for you. Some understanding of the Linux/UNIX command line interface is expected. What You Will Learn Write simple tasks and plays Organize code into a reusable, modular structure Separate code from data using variables and Jinja2 templates Run custom commands and scripts using Ansible’s command modules Control execution flow based on conditionals Integrate nodes and discover topology information about other nodes in the cluster Encrypt data with ansible-vault Create environments with isolated configurations to match application development workflow Orchestrate infrastructure and deploy applications in a coordinated manner In Detail Ansible combines configuration management, orchestration, and parallel command execution into a single tool. Its batteries-included approach and built-in module library makes it easy to integrate it with cloud platforms, databases, and notification services without requiring additional plugins. Playbooks in Ansible define the policies your systems under management enforce. They facilitate effective configuration management rather than running ad hoc scripts to deploy complex applications. This book will show you how to write a blueprint of your infrastructure encompassing multi-tier applications using Ansible’s playbooks. Beginning with the basic concepts such as plays, tasks, handlers, inventory, and the YAML syntax that Ansible uses, you will see how to organize your code into a modular structure. Building on this, you will master techniques to create data-driven playbooks with variables, templates, logical constructs, and encrypted data. This book will also take you through advanced clustering concepts such as discovering topology information, managing multiple environments, and orchestration. By the end of this book, you will be able to design solutions to your automation and orchestration problems using playbooks quickly and efficiently. Style and approach This book follows a step-by-step approach, with the concepts explained in a conversational and easy-to-follow style. Each topic is explained sequentially in the process of creating a course. A comprehensive explanation of the basic and advanced features of Ansible playbooks is also included.

Table of contents

Ansible Playbook Essentials
Table of Contents
Ansible Playbook Essentials
About the Author
About the Reviewers
What you need for this book
Who this book is for
Reader feedback
Customer support
Setting Up the Learning Environment
1. Blueprinting Your Infrastructure
Our first playbook
Review questions
2. Going Modular with Ansible Roles
Naming roles
The directory layout for roles
Creating a site-wide playbook, nesting, and using include statements
Creating the www playbook
Creating a base role
Creating an Nginx role
Automating events and actions with handlers
Adding pre-tasks and post-tasks to playbooks
Running playbooks with roles
Review questions
3. Separating Code and Data – Variables, Facts, and Templates
Separating code and data
Jinja2 templates
Facts and variables
Templating the Nginx configurations
Adding another layer – the MySQL role
Variable precedence
The best practices for variable usage
Review questions
4. Bringing In Your Code – Custom Commands and Scripts
Deploying a WordPress application – a hands-on approach
Review questions
5. Controlling Execution Flow – Conditionals
Refactoring the MySQL role
Conditional control structure in Jinja2 templates
Running a task only once
Executing roles conditionally
Review questions
6. Iterative Control Structures – Loops
Configuring WordPress requisites
The PHP5-FPM role
Creating MySQL databases and user accounts
Creating Nginx virtual hosts
Review questions
7. Node Discovery and Clustering
Creating the load balancer role
Accessing facts for non-playbook hosts
Review questions
8. Encrypting Data with Vault
Using the Ansible-vault
Encrypting the database credentials
Using a password file
Adding the vault password file option to the Ansible configuration
Review questions
9. Managing Environments
Creating a development environment
Review questions
10. Orchestrating Infrastructure with Ansible
Tagging the roles
Creating an orchestration playbook for WordPress
Review questions
A. References

Is Ansible Playbook Essentials Free to Download?

No, i'm afraid not. Every single book that we feature on is a paid-for, premium publication that you have to part your hard earned cash for. There is no point trying to find a free download of Ansible Playbook Essentials so please don't waste your time looking. Head over to Amazon to buy a physical or digital copy of Ansible Playbook Essentials. You can also buy a subscription from Perlego and gain access to over 500k textbooks and educational resources.

It is highly unlikely that you'll be able to find Ansible Playbook Essentials for free. There's a lot of websites that will say "Free Download" but these are just attempts to get you to click on a link which will either take you to an ad landing page or you risk getting viruses on your computer. In the rare occasion that you do find a free download for Ansible Playbook Essentials remember that it's illegal to download a book if you didn't pay for it!

If you really want Ansible Playbook Essentials and you want to truly own it the legal and safe way, then click here to visit the download and purchase page on The author and publisher deserves to be paid for their work, as they have put in the hours and the creativity to produce such an amazing publication / book.