Chapter 4. Larger Projects

Until now we have been looking at single plays in one playbook file. This approach will work for simple infrastructures, or when using Ansible as a simple deployment mechanism. However, if you have a large and complicated infrastructure, then you will need to take actions to prevent things from going out of control. This chapter will include the following topics:

  • Separating your playbooks into different files, and including them from some other location
  • Using roles to include multiple files that perform a similar function
  • Methods for increasing the speed at which Ansible configures your machines


One of the first issues you will face with a complex infrastructure is that your playbooks will rapidly increase in size. ...

Get Ansible Configuration Management - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.