Install RTMP only when using NGINX Plus (#91)

* Install RTMP only when using NGINX Plus

* Make GeoIP and NJS module tasks idempotent
This commit is contained in:
Alessandro Fael Garcia 2019-01-21 17:20:16 +01:00 committed by GitHub
parent 6693791de2
commit 8ead2b7c00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 16 deletions

View File

@ -12,10 +12,11 @@
when: nginx_type == "plus" when: nginx_type == "plus"
- name: "(Setup: All NGINX) Load NGINX GeoIP Module" - name: "(Setup: All NGINX) Load NGINX GeoIP Module"
blockinfile: lineinfile:
path: /etc/nginx/nginx.conf path: /etc/nginx/nginx.conf
insertbefore: BOF insertbefore: BOF
block: | line: "{{ item }}"
load_module modules/ngx_http_geoip_module.so; with_items:
load_module modules/ngx_stream_geoip_module.so; - load_module modules/ngx_http_geoip_module.so;
- load_module modules/ngx_stream_geoip_module.so;
notify: "(Handler: All OSs) Reload NGINX" notify: "(Handler: All OSs) Reload NGINX"

View File

@ -12,7 +12,7 @@
when: nginx_modules.image_filter | default(false) when: nginx_modules.image_filter | default(false)
- import_tasks: install-rtmp.yml - import_tasks: install-rtmp.yml
when: nginx_modules.rtmp | default(false) when: nginx_modules.rtmp | default(false) and nginx_type == "plus"
- import_tasks: install-xslt.yml - import_tasks: install-xslt.yml
when: nginx_modules.xslt | default(false) when: nginx_modules.xslt | default(false)

View File

@ -12,10 +12,11 @@
when: nginx_type == "plus" when: nginx_type == "plus"
- name: "(Setup: All NGINX) Load NGINX JavaScript Module" - name: "(Setup: All NGINX) Load NGINX JavaScript Module"
blockinfile: lineinfile:
path: /etc/nginx/nginx.conf path: /etc/nginx/nginx.conf
insertbefore: BOF insertbefore: BOF
block: | line: "{{ item }}"
load_module modules/ngx_http_js_module.so; with_items:
load_module modules/ngx_stream_js_module.so; - load_module modules/ngx_http_js_module.so;
- load_module modules/ngx_stream_js_module.so;
notify: "(Handler: All OSs) Reload NGINX" notify: "(Handler: All OSs) Reload NGINX"

View File

@ -1,15 +1,8 @@
--- ---
- name: "(Install: All OSs) Install NGINX Open Source RTMP Module"
package:
name: nginx-module-rtmp
state: present
when: nginx_type == "opensource"
- name: "(Install: All OSs) Install NGINX Plus RTMP Module" - name: "(Install: All OSs) Install NGINX Plus RTMP Module"
package: package:
name: nginx-plus-module-rtmp name: nginx-plus-module-rtmp
state: present state: present
when: nginx_type == "plus"
- name: "(Setup: All NGINX) Load NGINX RTMP Module" - name: "(Setup: All NGINX) Load NGINX RTMP Module"
lineinfile: lineinfile: