Skip to content

Commit bd0c581

Browse files
committed
Refactor installation of NGINX Unit modules
Use a list that lets users specify which modules they want to install instead of installing all modules available in each distro
1 parent 3a8e36e commit bd0c581

File tree

5 files changed

+12
-92
lines changed

5 files changed

+12
-92
lines changed

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ branch: mainline
3131
# Install NGINX Unit and NGINX Unit packages.
3232
# Default is false.
3333
unit_enable: false
34-
unit_packages: false
34+
unit_modules: null
3535

3636
# Install NGINX JavaScript, Perl, ModSecurity WAF (NGINX Plus only), GeoIP, Image-Filter, RTMP Media Streaming, and/or XSLT modules.
3737
# Default is false.

tasks/unit/install-modules.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- name: "(Install: All OSs) Install NGINX Unit Modules"
2+
package:
3+
name: "{{ item }}"
4+
state: present
5+
with_items: "{{ unit_modules }}"
6+
notify: "(Handler: All OSs) Start NGINX Unit"

tasks/unit/install-packages.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

tasks/unit/install-unit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
state: present
1212
notify: "(Handler: All OSs) Start NGINX Unit"
1313

14-
- import_tasks: install-packages.yml
15-
when: unit_packages
14+
- import_tasks: install-modules.yml
15+
when: unit_modules is defined and unit_modules

tests/playbooks/nginx-unit.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
- ansible-role-nginx
77
vars:
88
unit_enable: true
9-
unit_packages: true
9+
unit_modules:
10+
- unit-php
11+
- unit-perl

0 commit comments

Comments
 (0)