O'Reilly logo

Ansible Configuration Management - Second Edition by Daniel Hall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Advanced Playbooks

The playbooks that we have looked at so far are simple and just run a number of modules in order. Ansible allows much more control over the execution of your playbook. Using the following techniques, you should be able to perform even the most complex deployments:

  • Running operations in parallel
  • Looping
  • Conditional execution
  • Task delegation
  • Extra variables
  • Finding files with variables
  • Environment variables
  • External data lookups
  • Storing data
  • Processing data
  • Debugging playbooks

Running operations in parallel

By default, Ansible will only fork up to five times, so it will only run an operation on five different machines at once. If you have a large number of machines, or you have lowered this maximum fork value, then you may want ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required