Multi-distribution considerations
Looking at each of the Ansible built-in modules used in the three roles, stack_install
, stack_config
, and wordpress
, we are using a few that will not work on our newly introduced Rocky Linux box.
Let’s quickly work through each module and consider what we need to change or take into account when targeting two different distributions.
The Stack Install role
This role uses the following built-in modules:
ansible.builtin.apt
ansible.builtin.apt_key
ansible.builtin.apt_repository
We use these modules to update our operating system, add the NGINX mainline repository, and install all the packages we require for our WordPress installation.
As these modules all deal with package management, we won’t be able to reuse any of these tasks, meaning that we will need to split the role into two parts: one that deals with Debian-based systems and the other for Red Hat systems.
Additionally, we won’t be able...