Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Add timeout options to tunnel settings #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions manifests/tun.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@
# By default we look this value up in a stunnel::data class, which has a
# list of common answers.
#
# [*timeout_busy*]
# Time to wait for expected data
#
# [*timeout_close*]
# Time to wait for close_notify (set to 0 for buggy MSIE)
#
# [*timeout_connect*]
# Time to wait to connect to a remote host
#
# [*timeout_idle*]
# Time to keep an idle connection
#
# === Examples
#
# stunnel::tun { 'rsyncd':
Expand Down Expand Up @@ -107,11 +119,15 @@
$client,
$accept,
$connect,
$ssl_version = 'TLSv1',
$pid_file = "/${name}.pid",
$debug_level = '0',
$log_dest = "/var/log/${name}.log",
$conf_dir = $stunnel::params::conf_dir
$timeout_busy = undef,
$timeout_close = undef,
$timeout_connect = undef,
$timeout_idle = undef,
$ssl_version = 'TLSv1',
$pid_file = "/${name}.pid",
$debug_level = '0',
$log_dest = "/var/log/${name}.log",
$conf_dir = $stunnel::params::conf_dir
) {

$ssl_version_real = $ssl_version ? {
Expand Down
13 changes: 13 additions & 0 deletions templates/stunnel.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ output = <%= @log_dest %>

client = <%= @client_on %>

<%- if @timeout_busy != nil -%>
TIMEOUTbusy = <%= @timeout_busy %>
<%- end -%>
<%- if @timeout_close != nil -%>
TIMEOUTclose = <%= @timeout_close %>
<%- end -%>
<%- if @timeout_connect != nil -%>
TIMEOUTconnect = <%= @timeout_connect %>
<%- end -%>
<%- if @timeout_idle != nil -%>
TIMEOUTidle = <%= @timeout_idle %>
<%- end -%>

[<%= @name -%>]
accept = <%= @accept %>
connect = <%= @connect %>