From 3536069f1600ee781fc47c48097a5296e3a2329d Mon Sep 17 00:00:00 2001 From: TJ Biddle Date: Tue, 29 Oct 2013 11:55:40 -0700 Subject: [PATCH] Adding upstream fail_timeout. --- manifests/resource/upstream.pp | 4 +++- templates/conf.d/upstream.erb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/manifests/resource/upstream.pp b/manifests/resource/upstream.pp index 347b6166f..85e868c37 100644 --- a/manifests/resource/upstream.pp +++ b/manifests/resource/upstream.pp @@ -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: # @@ -40,6 +41,7 @@ $members, $ensure = 'present', $upstream_cfg_prepend = undef, + $upstream_fail_timeout = '10s', ) { File { owner => 'root', diff --git a/templates/conf.d/upstream.erb b/templates/conf.d/upstream.erb index fb0d7e889..26777de80 100644 --- a/templates/conf.d/upstream.erb +++ b/templates/conf.d/upstream.erb @@ -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 %> }