File tree Expand file tree Collapse file tree 7 files changed +25
-8
lines changed Expand file tree Collapse file tree 7 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,8 @@ The following parameters are available in the `nginx` class:
258
258
Data type: ` Boolean `
259
259
260
260
When set, nginx will include module configurations files installed in the
261
- /etc/nginx/modules-enabled directory.
261
+ /etc/nginx/modules-enabled directory. This is also enabled if mail is
262
+ being configured (to allow the module to be loaded).
262
263
263
264
Default value: ` $nginx::params::include_modules_enabled `
264
265
Original file line number Diff line number Diff line change 199
199
}
200
200
}
201
201
202
+ if ($include_modules_enabled or $nginx::mail ) {
203
+ file { "${conf_dir}/modules-enabled" :
204
+ ensure => directory ,
205
+ }
206
+ }
207
+
202
208
file { $log_dir:
203
209
ensure => directory ,
204
210
mode => $log_mode ,
Original file line number Diff line number Diff line change 10
10
#
11
11
# @param include_modules_enabled
12
12
# When set, nginx will include module configurations files installed in the
13
- # /etc/nginx/modules-enabled directory.
13
+ # /etc/nginx/modules-enabled directory. This is also enabled if mail is
14
+ # being configured (to allow the module to be loaded).
14
15
#
15
16
# @param passenger_package_name
16
17
# The name of the package to install in order for the passenger module of
224
225
Optional[Enum[' on' , ' off' ]] $daemon = undef ,
225
226
String[1] $daemon_user = $nginx::params::daemon_user,
226
227
Optional[String[1]] $daemon_group = undef ,
227
- Array[String] $dynamic_modules = $nginx::params::dynamic_modules ,
228
+ Array[String] $dynamic_modules = [] ,
228
229
String[1] $global_owner = ' root' ,
229
230
String[1] $global_group = $nginx::params::global_group,
230
231
Stdlib::Filemode $global_mode = ' 0644' ,
Original file line number Diff line number Diff line change 17
17
' mail_package_name' => undef ,
18
18
' manage_repo' => false ,
19
19
' include_modules_enabled' => false ,
20
- ' dynamic_modules' => [],
21
20
' mime_types' => {
22
21
' text/html' => ' html htm shtml' ,
23
22
' text/css' => ' css' ,
149
148
$_module_os_overrides = {
150
149
' log_group' => ' nginx' ,
151
150
' mail_package_name' => ' nginx-mod-mail' ,
152
- ' dynamic_modules' => [' /usr/lib64/nginx/modules/ngx_mail_module.so' ],
153
151
}
154
152
}
155
153
}
209
207
$log_mode = $_module_parameters[' log_mode' ]
210
208
$pid = $_module_parameters[' pid' ]
211
209
$include_modules_enabled = $_module_parameters[' include_modules_enabled' ]
212
- $dynamic_modules = $_module_parameters[' dynamic_modules' ]
213
210
214
211
$daemon_user = $_module_parameters[' daemon_user' ]
215
212
$global_group = $_module_parameters[' root_group' ]
Original file line number Diff line number Diff line change 194
194
package { $nginx::mail_package_name :
195
195
ensure => ' installed' ,
196
196
}
197
+ $mail_load_content = $facts [' os' ][' family' ] ? {
198
+ ' ArchLinux' => " load_module /usr/lib/nginx/modules/ngx_mail_module.so;\n " ,
199
+ ' RedHat' => " load_module /usr/lib64/nginx/modules/ngx_mail_module.so;\n " ,
200
+ }
201
+ file { '/etc/nginx/modules-enabled/mail.conf' :
202
+ ensure => ' file' ,
203
+ owner => ' root' ,
204
+ mode => ' 0644' ,
205
+ content => $mail_load_content ,
206
+ require => File [' /etc/nginx/modules-enabled' ],
207
+ }
197
208
}
198
209
199
210
# Add IPv6 Logic Check - Nginx service will not start if ipv6 is enabled
Original file line number Diff line number Diff line change 16
16
ipv6_enable : true
17
17
}
18
18
end
19
- let ( :pre_condition ) { [ 'include nginx' ] }
19
+ let ( :pre_condition ) { [ 'class { " nginx": mail => true } ' ] }
20
20
21
21
describe 'os-independent items' do
22
22
describe 'basic assumptions' do
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ load_module "<%= mod_item -%>";
6
6
load_module "modules/<%= mod_item -%> .so";
7
7
<%- end -%>
8
8
<%- end -%>
9
+
9
10
<% if @daemon -%>
10
11
daemon <%= @daemon %> ;
11
12
<% end -%>
@@ -23,7 +24,7 @@ pcre_jit <%= @pcre_jit %>;
23
24
<% if @pid -%>
24
25
pid <%= @pid %> ;
25
26
<% end -%>
26
- <% if @include_modules_enabled -%>
27
+ <% if @include_modules_enabled or @mail -%>
27
28
include /etc/nginx/modules-enabled/*.conf;
28
29
<% end -%>
29
30
<% if @nginx_cfg_prepend -%>
You can’t perform that action at this time.
0 commit comments