Skip to content

Commit 22992c0

Browse files
Edmilson-JRmmoll
authored andcommitted
Use current timeout management variables
configtimeout was deprecated since Puppet 4 and replaced with http_connection_timeout and http_read_timeout.
1 parent 8b1b7b2 commit 22992c0

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

manifests/agent/config.pp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515
'noop': value => $::puppet::agent_noop;
1616
'usecacheonfailure': value => $::puppet::usecacheonfailure;
1717
}
18-
if $::puppet::configtimeout != undef {
18+
if $::puppet::http_connect_timeout != undef {
1919
puppet::config::agent {
20-
'configtimeout': value => $::puppet::configtimeout;
20+
'http_connect_timeout': value => $::puppet::http_connect_timeout;
21+
}
22+
}
23+
if $::puppet::http_read_timeout != undef {
24+
puppet::config::agent {
25+
'http_read_timeout': value => $::puppet::http_read_timeout;
2126
}
2227
}
2328
if $::puppet::prerun_command {

manifests/init.pp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@
9292
#
9393
# $module_repository:: Use a different puppet module repository
9494
#
95-
# $configtimeout:: How long the client should wait for the
96-
# configuration to be retrieved before
97-
# considering it a failure.
98-
#
9995
# $ca_server:: Use a different ca server. Should be either
10096
# a string with the location of the ca_server
10197
# or 'false'.
@@ -119,6 +115,14 @@
119115
#
120116
# $additional_settings:: A hash of additional main settings.
121117
#
118+
# $http_connect_timeout:: The maximum amount of time an agent waits
119+
# when establishing an HTTP connection.
120+
#
121+
# $http_read_timeout:: The time an agent waits for one block to be
122+
# read from an HTTP connection. If nothing is
123+
# read after the elapsed interval then the
124+
# connection will be closed.
125+
#
122126
# == Advanced puppet parameters
123127
#
124128
# $user:: Override the name of the puppet user.
@@ -578,7 +582,8 @@
578582
Boolean $agent_noop = $puppet::params::agent_noop,
579583
Boolean $show_diff = $puppet::params::show_diff,
580584
Optional[Stdlib::HTTPUrl] $module_repository = $puppet::params::module_repository,
581-
Optional[Integer[0]] $configtimeout = $puppet::params::configtimeout,
585+
Optional[Integer[0]] $http_connect_timeout = $puppet::params::http_connect_timeout,
586+
Optional[Integer[0]] $http_read_timeout = $puppet::params::http_read_timeout,
582587
Optional[Variant[String, Boolean]] $ca_server = $puppet::params::ca_server,
583588
Optional[Integer[0, 65535]] $ca_port = $puppet::params::ca_port,
584589
Optional[String] $ca_crl_filepath = $puppet::params::ca_crl_filepath,

manifests/params.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@
152152
}
153153
}
154154

155-
$configtimeout = undef
155+
$http_connect_timeout = undef
156+
$http_read_timeout = undef
156157

157158
$autosign = "${dir}/autosign.conf"
158159
$autosign_entries = []

spec/classes/puppet_server_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@
141141

142142
it { should contain_concat(conf_file) }
143143

144-
it { should_not contain_puppet__config__agent('configtimeout') }
144+
it { should_not contain_puppet__config__agent('http_connect_timeout') }
145+
it { should_not contain_puppet__config__agent('http_read_timeout') }
145146
it { should_not contain_class('puppetdb') }
146147
it { should_not contain_class('puppetdb::master::config') }
147148
it { should_not contain_file("#{confdir}/custom_trusted_oid_mapping.yaml") }

0 commit comments

Comments
 (0)