Add retries for rabbitmqadmin file
Staging::file used by Rabbitmq::Install::Rabbitmqadmin cannot handle non transient (connectivity) errors. The solution is to add retries for the file transfer when non transient connection errors exist, which is: * sync upstream rabbitmq module fix for https://tickets.puppetlabs.com/browse/MODULES-1650 * sync upstream staging module fix for https://tickets.puppetlabs.com/browse/MODULES-1651 Closes-bug: #1410119 Change-Id: I7e38754d0d65480a71e3caaed723a41fb8784cbf Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
parent
9936c39e6d
commit
5551b1467b
|
@ -15,7 +15,8 @@ class rabbitmq::install::rabbitmqadmin {
|
|||
staging::file { 'rabbitmqadmin':
|
||||
target => '/var/lib/rabbitmq/rabbitmqadmin',
|
||||
source => "${protocol}://${default_user}:${default_pass}@localhost:${management_port}/cli/rabbitmqadmin",
|
||||
curl_option => '-k --noproxy localhost',
|
||||
curl_option => '-k --noproxy localhost --retry 30 --retry-delay 6',
|
||||
timeout => '180',
|
||||
wget_option => '--no-proxy',
|
||||
require => [
|
||||
Class['rabbitmq::service'],
|
||||
|
|
|
@ -19,6 +19,8 @@ define staging::file (
|
|||
$timeout = undef, #: the the time to wait for the file transfer to complete
|
||||
$curl_option = undef, #: options to pass to curl
|
||||
$wget_option = undef, #: options to pass to wget
|
||||
$tries = undef, #: amount of retries for the file transfer when non transient connection errors exist
|
||||
$try_sleep = undef, #: time to wait between retries for the file transfer
|
||||
$subdir = $caller_module_name
|
||||
) {
|
||||
|
||||
|
@ -46,6 +48,8 @@ define staging::file (
|
|||
cwd => $staging_dir,
|
||||
creates => $target_file,
|
||||
timeout => $timeout,
|
||||
try_sleep => $try_sleep,
|
||||
tries => $tries,
|
||||
logoutput => on_failure,
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,9 @@ describe 'staging::file', :type => :define do
|
|||
describe 'when deploying via http with parameters' do
|
||||
let(:title) { 'sample.tar.gz' }
|
||||
let(:params) { { :source => 'http://webserver/sample.tar.gz',
|
||||
:target => '/usr/local/sample.tar.gz',
|
||||
:target => '/usr/local/sample.tar.gz',
|
||||
:tries => '10',
|
||||
:try_sleep => '6',
|
||||
} }
|
||||
|
||||
it { should contain_file('/opt/staging')
|
||||
|
@ -80,6 +82,8 @@ describe 'staging::file', :type => :define do
|
|||
:environment => nil,
|
||||
:cwd => '/usr/local',
|
||||
:creates => '/usr/local/sample.tar.gz',
|
||||
:tries => '10',
|
||||
:try_sleep => '6',
|
||||
})
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue