Merge pull request #584 from brunoleon/maintenance
feat (maintenance): allow to specify maintenance behavior. Add docs.
This commit is contained in:
commit
2354132aa9
3 changed files with 6 additions and 2 deletions
|
@ -137,6 +137,9 @@
|
|||
# [*owner*] - Defines owner of the .conf file
|
||||
# [*group*] - Defines group of the .conf file
|
||||
# [*mode*] - Defines mode of the .conf file
|
||||
# [*maintenance*] - A boolean value to set a vhost in maintenance
|
||||
# [*maintenance_value*] - Value to return when maintenance is on.
|
||||
# Default to return 503
|
||||
# Actions:
|
||||
#
|
||||
# Requires:
|
||||
|
@ -235,6 +238,7 @@ define nginx::resource::vhost (
|
|||
$group = $::nginx::config::global_group,
|
||||
$mode = $::nginx::config::global_mode,
|
||||
$maintenance = false,
|
||||
$maintenance_value = 'return 503'
|
||||
) {
|
||||
|
||||
validate_re($ensure, '^(present|absent)$',
|
||||
|
|
|
@ -108,7 +108,7 @@ server {
|
|||
set $maintenance "off";
|
||||
<% end -%>
|
||||
if ($maintenance = "on") {
|
||||
return 503;
|
||||
<%= @maintenance_value %>;
|
||||
}
|
||||
<% if @rewrite_to_https -%>
|
||||
if ($ssl_protocol = "") {
|
||||
|
|
|
@ -82,7 +82,7 @@ server {
|
|||
set $maintenance "off";
|
||||
<% end -%>
|
||||
if ($maintenance = "on") {
|
||||
return 503;
|
||||
<%= @maintenance_value %>;
|
||||
}
|
||||
<% if Array(@resolver).count > 0 -%>
|
||||
resolver <% Array(@resolver).each do |r| %> <%= r %><% end %>;
|
||||
|
|
Loading…
Reference in a new issue