Merge pull request #3 from nginxinc/(feature)/support-all-modules

Add support for all first party NGINX modules
This commit is contained in:
Alessandro Fael Garcia 2018-02-09 12:23:29 -08:00 committed by GitHub
commit 4446ff2b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 99 additions and 5 deletions

View File

@ -7,12 +7,16 @@ type: opensource
# Options are 'mainline' or 'stable'. # Options are 'mainline' or 'stable'.
# Default is stable. # Default is stable.
branch: mainline branch: mainline
# Install nginscript, perl and/or waf modules. # Install nginscript, perl, waf, geoip, image-filter, rtmp and/or xslt modules.
# Default is false. # Default is false.
modules: modules:
njs: false njs: false
perl: false perl: false
waf: false waf: false
geoip: false
image_filter: false
rtmp: false
xslt: false
# Install NGINX Amplify. # Install NGINX Amplify.
# Use your NGINX Amplify API key. # Use your NGINX Amplify API key.
# Default is null. # Default is null.

View File

@ -17,6 +17,18 @@
- import_tasks: modules/install-perl.yml - import_tasks: modules/install-perl.yml
when: modules.perl when: modules.perl
- import_tasks: modules/install-geoip.yml
when: modules.geoip
- import_tasks: modules/install-image-filter.yml
when: modules.image_filter
- import_tasks: modules/install-rtmp.yml
when: modules.rtmp
- import_tasks: modules/install-xslt.yml
when: modules.xslt
- import_tasks: modules/install-waf.yml - import_tasks: modules/install-waf.yml
when: modules.waf and type == "plus" when: modules.waf and type == "plus"

View File

@ -0,0 +1,21 @@
---
- name: "(Install: All OSs) Install Open Source NGINX GeoIP Module"
package:
name: nginx-geoip-perl
state: present
when: type == "opensource"
- name: "(Install: All OSs) Install NGINX Plus GeoIP Module"
package:
name: nginx-plus-geoip-perl
state: present
when: type == "plus"
- name: "(Setup: All NGINX) Load NGINX GeoIP Module"
blockinfile:
path: /etc/nginx/nginx.conf
insertbefore: BOF
block: |
load_module modules/ngx_http_geoip_module.so;
load_module modules/ngx_stream_geoip_module.so;
notify: "(Handler: All OSs) Reload NGINX"

View File

@ -0,0 +1,19 @@
---
- name: "(Install: All OSs) Install Open Source NGINX Image Filter Module"
package:
name: nginx-module-image-filter
state: present
when: type == "opensource"
- name: "(Install: All OSs) Install NGINX Plus Image Filter Module"
package:
name: nginx-plus-module-image-filter
state: present
when: type == "plus"
- name: "(Setup: All NGINX) Load NGINX Image Filter Module"
lineinfile:
path: /etc/nginx/nginx.conf
insertbefore: BOF
line: load_module modules/ngx_http_image_filter_module.so;
notify: "(Handler: All OSs) Reload NGINX"

View File

@ -1,11 +1,11 @@
--- ---
- name: "(Install: All OSs) Install NGINX NJS Module" - name: "(Install: All OSs) Install Open Source NGINX NJS Module"
package: package:
name: nginx-module-njs name: nginx-module-njs
state: present state: present
when: type == "opensource" when: type == "opensource"
- name: "(Install: All OSs) Install NGINX NJS Module" - name: "(Install: All OSs) Install NGINX Plus NJS Module"
package: package:
name: nginx-plus-module-njs name: nginx-plus-module-njs
state: present state: present

View File

@ -1,11 +1,11 @@
--- ---
- name: "(Install: All OSs) Install NGINX Perl Module" - name: "(Install: All OSs) Install Open Source NGINX Perl Module"
package: package:
name: nginx-module-perl name: nginx-module-perl
state: present state: present
when: type == "opensource" when: type == "opensource"
- name: "(Install: All OSs) Install NGINX Perl Module" - name: "(Install: All OSs) Install NGINX Plus Perl Module"
package: package:
name: nginx-plus-module-perl name: nginx-plus-module-perl
state: present state: present

View File

@ -0,0 +1,19 @@
---
- name: "(Install: All OSs) Install Open Source NGINX RTMP Module"
package:
name: nginx-module-rtmp
state: present
when: type == "opensource"
- name: "(Install: All OSs) Install NGINX Plus RTMP Module"
package:
name: nginx-plus-module-rtmp
state: present
when: type == "plus"
- name: "(Setup: All NGINX) Load NGINX RTMP Module"
lineinfile:
path: /etc/nginx/nginx.conf
insertbefore: BOF
line: load_module modules/ngx_rtmp_module.so;
notify: "(Handler: All OSs) Reload NGINX"

View File

@ -0,0 +1,19 @@
---
- name: "(Install: All OSs) Install Open Source NGINX XSLT Module"
package:
name: nginx-module-xslt
state: present
when: type == "opensource"
- name: "(Install: All OSs) Install NGINX Plus XSLT Module"
package:
name: nginx-plus-module-xslt
state: present
when: type == "plus"
- name: "(Setup: All NGINX) Load NGINX XSLT Module"
lineinfile:
path: /etc/nginx/nginx.conf
insertbefore: BOF
line: load_module modules/ngx_http_xslt_filter_module.so;
notify: "(Handler: All OSs) Reload NGINX"