Merge pull request #675 from kronostechnologies/refact/upstream
adding a max_fails parameter to upstream member[s]
This commit is contained in:
commit
d4d55c309b
3 changed files with 4 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
|||
# [*ensure*] - Enables or disables the specified location (present|absent)
|
||||
# [*upstream_cfg_prepend*] - It expects a hash with custom directives to put before anything else inside upstream
|
||||
# [*upstream_fail_timeout*] - Set the fail_timeout for the upstream. Default is 10 seconds - As that is what Nginx does normally.
|
||||
# [*upstream_max_fails*] - Set the max_fails for the upstream. Default is to use nginx default value which is 1.
|
||||
#
|
||||
# Actions:
|
||||
#
|
||||
|
@ -43,6 +44,7 @@ define nginx::resource::upstream (
|
|||
$ensure = 'present',
|
||||
$upstream_cfg_prepend = undef,
|
||||
$upstream_fail_timeout = '10s',
|
||||
$upstream_max_fails = undef,
|
||||
) {
|
||||
|
||||
if $members != undef {
|
||||
|
|
|
@ -1 +1 @@
|
|||
server <%= @server %>:<%= @port %> fail_timeout=<%= @upstream_fail_timeout %>;
|
||||
server <%= @server %>:<%= @port %> fail_timeout=<%= @upstream_fail_timeout %><% if @upstream_max_fails -%> max_fails=<%=@upstream_max_fails %><% end %>;
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
<% @members.each do |i| %>
|
||||
server <%= i %> fail_timeout=<%= @upstream_fail_timeout %>;<% end %>
|
||||
server <%= i %> fail_timeout=<%= @upstream_fail_timeout %><% if @upstream_max_fails -%> max_fails=<%=@upstream_max_fails %><% end %>;<% end %>
|
||||
|
|
Loading…
Reference in a new issue