Skip to content

Commit 8ead2b7

Browse files
authored
Install RTMP only when using NGINX Plus (#91)
* Install RTMP only when using NGINX Plus * Make GeoIP and NJS module tasks idempotent
1 parent 6693791 commit 8ead2b7

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

tasks/modules/install-geoip.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
when: nginx_type == "plus"
1313

1414
- name: "(Setup: All NGINX) Load NGINX GeoIP Module"
15-
blockinfile:
15+
lineinfile:
1616
path: /etc/nginx/nginx.conf
1717
insertbefore: BOF
18-
block: |
19-
load_module modules/ngx_http_geoip_module.so;
20-
load_module modules/ngx_stream_geoip_module.so;
18+
line: "{{ item }}"
19+
with_items:
20+
- load_module modules/ngx_http_geoip_module.so;
21+
- load_module modules/ngx_stream_geoip_module.so;
2122
notify: "(Handler: All OSs) Reload NGINX"

tasks/modules/install-modules.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
when: nginx_modules.image_filter | default(false)
1313

1414
- import_tasks: install-rtmp.yml
15-
when: nginx_modules.rtmp | default(false)
15+
when: nginx_modules.rtmp | default(false) and nginx_type == "plus"
1616

1717
- import_tasks: install-xslt.yml
1818
when: nginx_modules.xslt | default(false)

tasks/modules/install-njs.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
when: nginx_type == "plus"
1313

1414
- name: "(Setup: All NGINX) Load NGINX JavaScript Module"
15-
blockinfile:
15+
lineinfile:
1616
path: /etc/nginx/nginx.conf
1717
insertbefore: BOF
18-
block: |
19-
load_module modules/ngx_http_js_module.so;
20-
load_module modules/ngx_stream_js_module.so;
18+
line: "{{ item }}"
19+
with_items:
20+
- load_module modules/ngx_http_js_module.so;
21+
- load_module modules/ngx_stream_js_module.so;
2122
notify: "(Handler: All OSs) Reload NGINX"

tasks/modules/install-rtmp.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
---
2-
- name: "(Install: All OSs) Install NGINX Open Source RTMP Module"
3-
package:
4-
name: nginx-module-rtmp
5-
state: present
6-
when: nginx_type == "opensource"
7-
82
- name: "(Install: All OSs) Install NGINX Plus RTMP Module"
93
package:
104
name: nginx-plus-module-rtmp
115
state: present
12-
when: nginx_type == "plus"
136

147
- name: "(Setup: All NGINX) Load NGINX RTMP Module"
158
lineinfile:

0 commit comments

Comments
 (0)