Skip to content

Commit

Permalink
Use current timeout management variables
Browse files Browse the repository at this point in the history
configtimeout was deprecated since Puppet 4 and replaced with
http_connection_timeout and http_read_timeout.
  • Loading branch information
Edmilson-JR authored and mmoll committed Apr 16, 2019
1 parent 8b1b7b2 commit 22992c0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
9 changes: 7 additions & 2 deletions manifests/agent/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@
'noop': value => $::puppet::agent_noop;
'usecacheonfailure': value => $::puppet::usecacheonfailure;
}
if $::puppet::configtimeout != undef {
if $::puppet::http_connect_timeout != undef {
puppet::config::agent {
'configtimeout': value => $::puppet::configtimeout;
'http_connect_timeout': value => $::puppet::http_connect_timeout;
}
}
if $::puppet::http_read_timeout != undef {
puppet::config::agent {
'http_read_timeout': value => $::puppet::http_read_timeout;
}
}
if $::puppet::prerun_command {
Expand Down
15 changes: 10 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@
#
# $module_repository:: Use a different puppet module repository
#
# $configtimeout:: How long the client should wait for the
# configuration to be retrieved before
# considering it a failure.
#
# $ca_server:: Use a different ca server. Should be either
# a string with the location of the ca_server
# or 'false'.
Expand All @@ -119,6 +115,14 @@
#
# $additional_settings:: A hash of additional main settings.
#
# $http_connect_timeout:: The maximum amount of time an agent waits
# when establishing an HTTP connection.
#
# $http_read_timeout:: The time an agent waits for one block to be
# read from an HTTP connection. If nothing is
# read after the elapsed interval then the
# connection will be closed.
#
# == Advanced puppet parameters
#
# $user:: Override the name of the puppet user.
Expand Down Expand Up @@ -578,7 +582,8 @@
Boolean $agent_noop = $puppet::params::agent_noop,
Boolean $show_diff = $puppet::params::show_diff,
Optional[Stdlib::HTTPUrl] $module_repository = $puppet::params::module_repository,
Optional[Integer[0]] $configtimeout = $puppet::params::configtimeout,
Optional[Integer[0]] $http_connect_timeout = $puppet::params::http_connect_timeout,
Optional[Integer[0]] $http_read_timeout = $puppet::params::http_read_timeout,
Optional[Variant[String, Boolean]] $ca_server = $puppet::params::ca_server,
Optional[Integer[0, 65535]] $ca_port = $puppet::params::ca_port,
Optional[String] $ca_crl_filepath = $puppet::params::ca_crl_filepath,
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
}
}

$configtimeout = undef
$http_connect_timeout = undef
$http_read_timeout = undef

$autosign = "${dir}/autosign.conf"
$autosign_entries = []
Expand Down
3 changes: 2 additions & 1 deletion spec/classes/puppet_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@

it { should contain_concat(conf_file) }

it { should_not contain_puppet__config__agent('configtimeout') }
it { should_not contain_puppet__config__agent('http_connect_timeout') }
it { should_not contain_puppet__config__agent('http_read_timeout') }
it { should_not contain_class('puppetdb') }
it { should_not contain_class('puppetdb::master::config') }
it { should_not contain_file("#{confdir}/custom_trusted_oid_mapping.yaml") }
Expand Down

0 comments on commit 22992c0

Please sign in to comment.