The preferred directory layout
As we have explored Ansible throughout this book, we have shown many times that the more your playbook grows in size and scale, the more likely you are to want to divide it up into multiple files and directories. A great example of this is roles, which we covered in Chapter 4, Playbooks and Roles, where we defined roles to not only enable us to reuse common automation code but also to split up what could potentially be a massive, single playbook into smaller, logically organized, manageable chunks. We also looked, in Chapter 3, Defining Your Inventory, at the process of defining your inventory file and how you can also split this up across multiple files and directories. What we have not looked at, however, is how we can put all of this together. All of this is documented in the official Ansible documentation at https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#content-organization.
However, in this chapter, let’...