Skip to content

Commit

Permalink
rollback breaking default, fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Enrice committed Jun 5, 2024
1 parent 457521b commit ea8ef88
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4178,7 +4178,7 @@ Default value: `undef`

Data type: `Optional[Variant[String, Array]]`

Where to write error log. May set to 'absent', in which case it will be omitted in this
Where to write error log. May be set to 'absent', in which case it will be omitted in this
server stanza (and default to nginx.conf setting)

Default value: `undef`
Expand All @@ -4187,9 +4187,9 @@ Default value: `undef`

Data type: `Optional[Nginx::ErrorLogSeverity]`

Optional error level. Defaults to nginx.conf setting
Optional error level

Default value: `$nginx::nginx_error_log_severity`
Default value: `undef`

##### <a name="-nginx--resource--server--passenger_cgi_param"></a>`passenger_cgi_param`

Expand Down
6 changes: 3 additions & 3 deletions manifests/resource/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@
# server stanza, rather than setting a default. Can also be disabled for this
# server with the string 'off'.
# @param error_log
# Where to write error log. May set to 'absent', in which case it will be omitted in this
# Where to write error log. May be set to 'absent', in which case it will be omitted in this
# server stanza (and default to nginx.conf setting)
# @param error_log_severity
# Optional error level. Defaults to nginx.conf setting
# Optional error level
# @param passenger_cgi_param
# Allows one to define additional CGI environment variables to pass to the backend application
# @param passenger_set_header
Expand Down Expand Up @@ -400,7 +400,7 @@
Optional[Array[String]] $include_files = undef,
Optional[Variant[String, Array]] $access_log = undef,
Optional[Variant[String, Array]] $error_log = undef,
Optional[Nginx::ErrorLogSeverity] $error_log_severity = $nginx::nginx_error_log_severity,
Optional[Nginx::ErrorLogSeverity] $error_log_severity = undef,
Optional[String] $format_log = $nginx::http_format_log,
Optional[Hash] $passenger_cgi_param = undef,
Optional[Hash] $passenger_set_header = undef,
Expand Down
26 changes: 13 additions & 13 deletions spec/defines/resource_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
value: true,
match: %r{\s+return\s+301\s+http://rspec\.example\.com\$request_uri;\n
\s+access_log\s+/var/log/nginx/www.rspec.example.com.access.log;\n
\s+error_log\s+/var/log/nginx/www.rspec.example.com.error.log error;\n}x
\s+error_log\s+/var/log/nginx/www.rspec.example.com.error.log;\n}x
},
{
title: 'should not contain www to non-www rewrite',
Expand Down Expand Up @@ -347,28 +347,28 @@
title: 'should set error_log',
attr: 'error_log',
value: '/path/to/error.log',
match: ' error_log /path/to/error.log error;'
match: ' error_log /path/to/error.log;'
},
{
title: 'should allow multiple error_log directives',
attr: 'error_log',
value: ['/path/to/error.log', 'syslog:server=localhost'],
match: [
' error_log /path/to/error.log error;',
' error_log syslog:server=localhost error;'
' error_log /path/to/error.log;',
' error_log syslog:server=localhost;'
]
},
{
title: 'should set error_log severity level',
attr: 'error_log_severity',
value: 'warn',
match: ' error_log /path/to/error.log warn;'
match: ' error_log /var/log/nginx/www.rspec.example.com.error.log warn;'
},
{
title: 'should not set error_log severity level',
attr: 'error_log_severity',
value: :undef,
match: ' error_log /path/to/error.log;'
match: ' error_log /var/log/nginx/www.rspec.example.com.error.log;'
},
{
title: 'should not include error_log in server when set to absent',
Expand Down Expand Up @@ -444,7 +444,7 @@
value: true,
match: %r{\s+return\s+301\s+http://www.rspec\.example\.com\$request_uri;\n
\s+access_log\s+/var/log/nginx/rspec.example.com.access.log;\n
\s+error_log\s+/var/log/nginx/rspec.example.com.error.log error;\n}x
\s+error_log\s+/var/log/nginx/rspec.example.com.error.log;\n}x
},
{
title: 'should not contain non-www to www rewrite',
Expand Down Expand Up @@ -511,7 +511,7 @@
value: true,
match: %r{\s+return\s+301\s+https://www.rspec\.example\.com\$request_uri;\n
\s+access_log\s+/var/log/nginx/ssl-rspec.example.com.access.log;\n
\s+error_log\s+/var/log/nginx/ssl-rspec.example.com.error.log error;\n}x
\s+error_log\s+/var/log/nginx/ssl-rspec.example.com.error.log;\n}x
},
{
title: 'should not contain non-www to www rewrite',
Expand Down Expand Up @@ -1018,28 +1018,28 @@
title: 'should set error_log',
attr: 'error_log',
value: '/path/to/error.log',
match: ' error_log /path/to/error.log error;'
match: ' error_log /path/to/error.log;'
},
{
title: 'should allow multiple error_log directives',
attr: 'error_log',
value: ['/path/to/error.log', 'syslog:server=localhost'],
match: [
' error_log /path/to/error.log error;',
' error_log syslog:server=localhost error;'
' error_log /path/to/error.log;',
' error_log syslog:server=localhost;'
]
},
{
title: 'should set error_log severity level',
attr: 'error_log_severity',
value: 'warn',
match: ' error_log /path/to/error.log warn;'
match: ' error_log /var/log/nginx/ssl-www.rspec.example.com.error.log warn;'
},
{
title: 'should not set error_log severity level',
attr: 'error_log_severity',
value: :undef,
match: ' error_log /path/to/error.log;'
match: ' error_log /var/log/nginx/ssl-www.rspec.example.com.error.log;'
},
{
title: 'should not include error_log in server when set to absent',
Expand Down

0 comments on commit ea8ef88

Please sign in to comment.