Skip to content

Commit

Permalink
Adding upstream fail_timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ Biddle committed Oct 29, 2013
1 parent 1682c81 commit 44853e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion manifests/resource/upstream.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# Parameters:
# [*members*] - Array of member URIs for NGINX to connect to. Must follow valid NGINX syntax.
# [*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_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.
#
# Actions:
#
Expand Down Expand Up @@ -40,6 +41,7 @@
$members,
$ensure = 'present',
$upstream_cfg_prepend = undef,
$upstream_fail_timeout = '10s',
) {
File {
owner => 'root',
Expand Down
2 changes: 1 addition & 1 deletion templates/conf.d/upstream.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ upstream <%= @name %> {
<% if @upstream_cfg_prepend -%><% upstream_cfg_prepend.sort_by{|k,v| k}.each do |key,value| %>
<%= key %> <%= value %>;<% end -%><% end -%>
<% @members.each do |i| %>
server <%= i %>;<% end %>
server <%= i %> fail_timeout=<%= @upstream_fail_timeout %>;<% end %>
}

0 comments on commit 44853e4

Please sign in to comment.