Creating the Apache and MySQL playbooks
As our goal is to spin up a scalable LAMP stack in this chapter, we need to start by defining Ansible playbooks that would run on the build Virtual Machine. We've already created some roles for Apache and MySQL in Chapter 7, Configuration Management with Ansible. We will use the same roles within this setup as well.
Therefore, we will have the following directory structure within the ch8
directory:
. ├── dbserver-playbook.yaml ├── dbserver-packer.json ├── roles │  ├── apache │  ├── common │  └── mysql ├── webserver-playbook.json └── webserver-packer.yaml
We have two playbooks here – webserver-playbook.yaml
and dbserver-playbook.yaml
. Let's look at each one to understand how we write our playbooks for...