The stack_install role
We are going to start by creating a role called stack_install
using ansible-galaxy
role init
:
$ ansible-galaxy role init roles/stack_install
This will install our initial software stack. Once installed, we hand it over to a second role, which will then configure the software stack before a third role starts the WordPress installation.
So, what packages do we need? WordPress has the following requirements:
- PHP 7.4 or greater
- MySQL 5.7 or greater OR MariaDB 10.4 or greater
- Nginx or Apache with the
mod_rewrite
module - HTTPS support
We know from the previous chapter that the versions of PHP and MariaDB we are installing meet this requirement, leaving just NGINX, which we can download and install from the principal NGINX repository to get the latest and greatest version.
Enabling the NGINX repository
Before we look at the tasks and variables that we will need to enable the mainline NGINX repository, let’s start off the...