You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
These custom modules cannot be installed via pre_tasks, because they will require nginx package, which wasn' installed at this moment.
These custom modules cannot be installed via tasks or post_tasks, because nginx.conf will contain loading of these modules via load_module "modules/ngx_http_geoip2_module.so";, so nginx won't be restarted correctly when this role will notify 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 package nginx with the system package manager".
There will be no problems here as long as there is package nginx in the system or my own repositories. But what if we distribute our package with a different name, for example nginx-custom, so that when updating the packages via yum update, we do not accidentally install package nginx 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 the nginx package, and, accordingly, all the modules for it (like package nginx-custom and modules nginx-custom-module-geoip2).
The text was updated successfully, but these errors were encountered:
Anything related to installing modules should probably live in https://github.com/nginxinc/ansible-role-nginx instead of here. That being said, adding a list variable to the template for load_modules would make sense within this role.
The modules that are currently supported reflect the modules that are officially supported in some way or shape by NGINX (you can check them here https://docs.nginx.com/nginx/admin-guide/dynamic-modules/dynamic-modules/). There're no plans at the moment to support installing custom or third party modules. That being said, a few modules have been added since modules were last tweaked in this role (including an in house supported brotli module). I'll work on implementing them as soon as I can.
Following from the previous point, there're also no plans at the moment to support installing custom NGINX packages. Allowing to install NGINX from each distros package repository was the one exception (and is not recommended under most circumstances).
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 nginxinc/ansible-role-nginx#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 package
nginx
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 the
nginx
package, and, accordingly, all the modules for it (like packagenginx-custom
and modulesnginx-custom-module-geoip2
).The text was updated successfully, but these errors were encountered: