Skip to content

Commit 62db1bb

Browse files
authored
Add static core modules support to installation from source (#448)
1 parent 028c1d1 commit 62db1bb

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

defaults/main/main.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,18 @@ nginx_setup_license: true
9292
# Default is true.
9393
nginx_remove_license: true
9494

95-
# Install NGINX Modules.
96-
# You can select any of the modules listed below. Beware of NGINX Plus only modules (these are marked).
97-
# Format is list with either the module name or a dictionary (see njs for an example).
95+
# Install NGINX Static Modules.
96+
# You can select any of the static modules listed on http://nginx.org/en/docs/configure.html.
97+
# Format is '--with-*' where '*' should be used as static module name in the list below. (see an example below).
98+
# Default is 'http_ssl_module'. (DO NOT remove it if you need SSL support).
99+
nginx_static_modules: ['http_ssl_module']
100+
# nginx_static_modules: ['http_v2_module'] # Example for '--with-http_v2_module'
101+
102+
# Install NGINX Dynamic Modules.
103+
# You can select any of the dynamic modules listed below. Beware of NGINX Plus only dynamic modules (these are marked).
104+
# Format is list with either the dynamic module name or a dictionary (see njs for an example).
98105
# When using a dictionary, the default value for state is present, and for version it's nginx_version if specified.
99-
# Default is an empty list (no modules are installed).
106+
# Default is an empty list (no dynamic modules are installed).
100107
nginx_modules: []
101108
# - auth-spnego # NGINX Plus
102109
# - brotli # NGINX Plus

molecule/source/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
nginx_install_from: source
1212
nginx_branch: stable
13+
nginx_static_modules: ['http_ssl_module']
1314
nginx_install_source_build_tools: true
1415
nginx_install_source_pcre: true
1516
nginx_install_source_openssl: true

tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
when: nginx_type == "plus"
4343
tags: nginx_install_plus
4444

45-
- name: Install NGINX modules
45+
- name: Install NGINX dynamic modules
4646
include_tasks: "{{ role_path }}/tasks/modules/install-modules.yml"
4747
when:
4848
- nginx_modules is defined

tasks/opensource/install-source.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@
312312
src: "{{ nginx_source.dest }}"
313313
mode: 0755
314314

315+
- name: Set static modules
316+
set_fact:
317+
nginx_install_source_static_modules: "{{ nginx_install_source_static_modules | default('') + ' --with-' + item }}"
318+
loop: "{{ nginx_static_modules }}"
319+
315320
- name: Configure NGINX
316321
command: >-
317322
./configure
@@ -322,12 +327,12 @@
322327
--modules-path=/usr/lib/nginx/modules
323328
--prefix=/usr
324329
--pid-path=/var/run/nginx.pid
325-
--with-http_ssl_module
326330
--with-mail=dynamic
327331
--with-stream
328332
{{ nginx_install_source_pcre | ternary('', '--with-pcre=../' + pcre_version) }}
329333
{{ nginx_install_source_zlib | ternary('', '--with-zlib=../' + zlib_version) }}
330334
{{ nginx_install_source_openssl | ternary('', '--with-openssl=../' + openssl_version) }}
335+
{{ nginx_install_source_static_modules | default('') }}
331336
args:
332337
chdir: "/tmp/{{ nginx_version }}"
333338
register: nginx_configure

vars/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ pcre_version: pcre-8.44
7272
zlib_version: zlib-1.2.11
7373
openssl_version: openssl-1.1.1g
7474

75-
# Supported NGINX Open Source modules
75+
# Supported NGINX Open Source dynamic modules
7676
nginx_modules_list: [
7777
'geoip', 'image-filter', 'njs', 'perl', 'xslt',
7878
]
7979

80-
# Supported NGINX Plus modules
80+
# Supported NGINX Plus dynamic modules
8181
nginx_plus_modules_list: [
8282
'auth-spnego', 'brotli', 'cookie-flag', 'encrypted-session', 'geoip', 'geoip2', 'headers-more', 'image-filter',
8383
'lua', 'njs', 'opentracing', 'passenger', 'perl', 'prometheus', 'rtmp', 'subs-filter', 'xslt',

0 commit comments

Comments
 (0)