-
Notifications
You must be signed in to change notification settings - Fork 302
Configuring modules is currently limited to Centos/RHEL only #236
Comments
I'm making progress on the PR for this, actually, it is pretty much done, I'm just testing it further currently. It isn't quite as clean as may have been hoped, simply due to the variation in different operating systems and package repositories. I figured I would record a some detail of this so if anyone goes looking there is some rationale behind it. There are 4 configurations I'll look to cater for.
Config 1 - Centos/RHEL with EPEL repoWith the default setting for installing only the package "nginx", the installation task should bring down Nginx, a bunch of modules, and a nicely configured filesystem all ready for use with SELinux. Module .so files live in The n.b this will allow backward compatibility, as anyone already managing modules will only be using EPEL and will be specifying config files and not module files. Config 2 - Centos/RHEL with official Nginx repoAny modules needed should be added to and specified in the The Config 3 - Debian/Ubuntu with APT repoWith the default setting for installing only the package "nginx", the installation task should bring down Nginx and a bunch of modules. Module .so files live in These 50- files are in the way for us, so I've added tasks to rename these files out of way if they exist for any particular module which we choose to manage. The file is renamed to something like n.b the functionality to disable modules via the role is not working yet, the code doing the enabling however is aware to not enable anything if it is specified in the do not enable section, even if it is also in the enable section. The Config 4 - Debian/Ubuntu with official Nginx repoFairly similar to Config 2. Any modules needed should be added to and specified in the The Other considerationsThe 2 options for what is needed in The general idea is to have files in The 2 options for where the actual module .so files live is catered for with a new variable All in all, it isn't too bad, perhaps seeing the code will explain it all anyway. Hopefully, just another day or so and I'll send in a PR. Cheers. |
Module configuration should now work for the following: Centos/RHEL with either EPEL or Official Nginx repo Debian/Ubuntu with either standard APT repo or Official Nginx repo Please see issue jdauphant#236 for further details.
* Explicitly setting the nginx configuration file in (jdauphant#223) the "check nginx configuration" handler. * Fixing Ansible 2.7.0 deprication warnings (jdauphant#225) * * Fixing Ansible 2.7.0 deprication warnings For further details take a look at: https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.7.html#using-a-loop-on-a-package-module-via-squash-actions * * Remving travis deprecation warning - Moving from "--sudo" to "--become" * * Ignoring symlinks errors during ansible_check_mode * Small spelling correction (jdauphant#228) * Add support to declare nginx modules in config file (jdauphant#227) * We can declare nginx modules now * We can declare nginx modules now * Correct load_module definition in template * Add task to remove `default.conf` from sites-enabled/ (jdauphant#231) * Add task to remove `default.conf` from sites-enabled/ * Check if `default` site is not inside user config * fix modules definition and add README section about this feature (jdauphant#232) * Fix typo in modules config and restrict to EPEL (jdauphant#232) (jdauphant#235) * Fix typo in modules config and restrict to EPEL (jdauphant#232) * Fixes warning from duplicate when's in modules configuration (jdauphant#233) * Extends support for configuring modules (jdauphant#236) (jdauphant#237) Module configuration should now work for the following: Centos/RHEL with either EPEL or Official Nginx repo Debian/Ubuntu with either standard APT repo or Official Nginx repo Please see issue jdauphant#236 for further details. * Update README.md * download mime.types file if it's missing (jdauphant#241) * configuration: allow templates for conf.d independent files (jdauphant#238) * Fix for jdauphant#242 Stick to ansible-lint rules. (jdauphant#243) * trailing whitespace * [701] Role info should contain description * [601] Don't compare to literal True/False * [502] All tasks should be named * [206] Variables should have spaces before and after: {{ var_name }} * skip_ansible_lint rule [403] Package installs should not use latest * [204] Lines should be no longer than 160 chars Co-authored-by: Timo Runge <timorunge@users.noreply.github.com> Co-authored-by: TheSycamore <TheSycamore@users.noreply.github.com> Co-authored-by: Dmitry Ge <22640222+q2digger@users.noreply.github.com> Co-authored-by: Tommaso <p.tommy93@gmail.com> Co-authored-by: Perry Kollmorgen <pcjkollmorgen@hotmail.com> Co-authored-by: Julien DAUPHANT <jdauphant@users.noreply.github.com> Co-authored-by: Tony Crowe <hellotonycrowe@protonmail.com> Co-authored-by: paulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com> Co-authored-by: Bas <bas.meijer@me.com>
As mentioned in #232 and #233 the configuring modules section is currently limited to Centos/RHEL only.
I'm working on a PR to expand this and standardise the process if possible.
The current idea is to not follow the current method adding a symlink:
/etc/nginx/modules-enabled/<shortname>.conf
->/usr/share/nginx/modules/<shortname>.conf
To instead first create a
.conf
file for a givenfilename.so
module file and save as:/etc/nginx/modules-available/filename.conf
There was some functionality to do this removed however the template file still exists.
Then add a symlink:
/etc/nginx/modules-enabled/<filename>.conf
->/etc/nginx/modules-available/<filename>.conf
Personally I think this is cleaner as it keeps to the
<something>-available
and<something>-enabled
model used in other parts of the configuration.Potentially we could keep support for using the
<shortname>
and EPEL provided .conf files already for when using EPEL and only use the template created<filename>.conf
files for Official Nginx repo provided modules and for Ubuntu/Debian also.The concern however is if anyone is already managing modules with links only directly to
/usr/share/nginx/modules
files, they would need to remove these links. Considering how new the recent commits are however and that there was a typo preventing their use at all I'd hazard a guess to say not many people are in this situation.n.b I do understand other distros may use something other than /etc/nginx for the main configuration folder. I've just used this above as an example and to make things a little clearer.
The text was updated successfully, but these errors were encountered: