The stack_config role
Now that we have our base software stack installed we need to configure it, let’s start by creating the role by running the following command:
$ ansible-galaxy role init roles/stack_config
This gives us the basic file structure needed for the stack_config
role. With that in place, we can now look at configuring the role itself – in this role, we will need to do the following:
- Add a system user for our WordPress installation to run under
- Configure NGINX as per the best practices on the WordPress documentation
- Configure PHP-FPM to run as the WordPress user we created earlier
As we need a user for WordPress to run under, we should make a start there.
WordPress system user
The defaults for the WordPress system user, which should be placed in roles/stackconfig/defaults/main.yml
, are as follows:
wordpress_system: user: "wordpress" group: "php-fpm" comment: "...