Preinstallation tasks

As mentioned in the previous chapter, a LEMP stack is composed of the following elements:

  • Linux: In our case, this will be CentOS 7 again
  • NGINX: If you remember, it is pronounced as engine-x, and replaces Apache in our stack
  • MariaDB: As we have seen, this will be the database component
  • PHP: We will be using PHP 7.2 again for this

Before we install WordPress, we need to install and configure these components. Also, as this playbook is eventually going to be executed against publicly available cloud servers, we need to think about some best practices around our NGINX configuration.

Let's start by getting the initial structure of the playbook set up:

$ mkdir lemp lemp/group_vars$ touch lemp/group_vars/common.yml lemp/production ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.