From 68633437e49f0e740f4dcae7754e025755ab89c2 Mon Sep 17 00:00:00 2001 From: Dmitry Ge <22640222+q2digger@users.noreply.github.com> Date: Wed, 17 Oct 2018 19:57:16 +0300 Subject: [PATCH] fix modules definition and add README section about this feature (#232) --- README.md | 11 +++++++++++ tasks/configuration.yml | 11 ++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a4841b6..e4ba230 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,17 @@ nginx_set_real_ip_from_cloudflare: True nginx_amplify: true nginx_amplify_api_key: "your_api_key_goes_here" nginx_amplify_update_agent: true + +# Define modules (only for RHEL & CentOS). +# available modules:. +# - mod-http-geoip +# - mod-http-image-filter +# - mod-http-perl +# - mod-http-xslt-filter +# - mod-mail +# - mod-stream +nginx_module_configs: + - mod-http-geoip ``` Examples diff --git a/tasks/configuration.yml b/tasks/configuration.yml index 1c23ec6..8e5a982 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -59,21 +59,14 @@ - reload nginx when: nginx_stream_params or nginx_stream_configs -- name: Create configuration for modules - template: - src: module.conf.j2 - dest: "{{ nginx_conf_dir }}/modules-available/{{ item }}.conf" - loop: "{{ nginx_module_configs }}" - notify: - - reload nginx - - name: Create links for modules-enabled file: state: link - src: "{{ nginx_conf_dir }}/modules-available/{{ item }}.conf" + src: "/urs/share/nginx/modules/{{ item }}.conf" dest: "{{ nginx_conf_dir }}/modules-enabled/{{ item }}.conf" with_items: "{{ nginx_module_configs }}" when: (item not in nginx_remove_modules) and (item not in nginx_disabled_modules) ignore_errors: "{{ ansible_check_mode }}" notify: - reload nginx + when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'