Closed StudioMaX closed 4 years ago
A few thoughts:
load_modules
would make sense within this role.brotli
module). I'll work on implementing them as soon as I can.I'm marking this issue as wontfix since there's no plans in the near future to support custom modules, but I've created a new issue to track the implementation of pending official supported modules in the ansible-role-nginx
repo https://github.com/nginxinc/ansible-role-nginx/issues/314
To install nginx I use my own RPM repository (for CentOS 7/8). This is necessary because standard repositories (CentOS and the official nginx RPM repository) lack many necessary modules, for example https://github.com/leev/ngx_http_geoip2_module, https://github.com/google/ngx_brotli and a few else. Therefore, instead of compiling the nginx right on the production server, I build it locally and distribute it through my RPM repository, which was installed via
pre_tasks
before executing this role.Is your feature request related to a problem? Please describe. Now we can install only those modules for which separate tasks have been created: njs, perl, waf (Nginx Plus), geoip (RHEL < 8), image_filter, rtmp (Nginx Plus), xslt. But we are not able to install any other module, since there is no task to install the list of extra packages.
Describe the solution you'd like All tasks for all operating systems must be changes to install any extra package BEFORE starting/restarting/reloading nginx. This must be some sort of
Additional context
pre_tasks
, because they will requirenginx
package, which wasn' installed at this moment.tasks
orpost_tasks
, becausenginx.conf
will contain loading of these modules viaload_module "modules/ngx_http_geoip2_module.so";
, so nginx won't be restarted correctly when this role willnotify
about this.There is a second problem here, since neither the CentOS repositories nor the official nginx repos contain any other modules. From the ansible side, this will look exactly the same as if you set
nginx_install_from == "os_repository"
, which means "do not install official nginx repository, just install packagenginx
with the system package manager". There will be no problems here as long as there is packagenginx
in the system or my own repositories. But what if we distribute our package with a different name, for examplenginx-custom
, so that when updating the packages viayum update
, we do not accidentally install packagenginx
from some other repositories, which may have a version higher than in my own repository. Therefore, we need some way to specify the name of thenginx
package, and, accordingly, all the modules for it (like packagenginx-custom
and modulesnginx-custom-module-geoip2
).