Allow tuning timeout for package update
Sometimes package update takes very long. This introduces a parameter to make the command timeout tunable. Change-Id: Icf089b50f497f3200e55877894b555e1e84a2d64
This commit is contained in:
parent
8359663751
commit
0f4c670e3d
manifests/repo/redhat
releasenotes/notes
spec/classes
@ -65,6 +65,10 @@
|
|||||||
# configured.
|
# configured.
|
||||||
# Defaults to false
|
# Defaults to false
|
||||||
#
|
#
|
||||||
|
# [*update_timeout*]
|
||||||
|
# (Optional) Timeout for package update.
|
||||||
|
# Defaults to 600
|
||||||
|
#
|
||||||
class openstack_extras::repo::redhat::redhat (
|
class openstack_extras::repo::redhat::redhat (
|
||||||
$release = $openstack_extras::repo::redhat::params::release,
|
$release = $openstack_extras::repo::redhat::params::release,
|
||||||
$manage_rdo = true,
|
$manage_rdo = true,
|
||||||
@ -79,6 +83,7 @@ class openstack_extras::repo::redhat::redhat (
|
|||||||
$package_require = false,
|
$package_require = false,
|
||||||
$centos_mirror_url = $openstack_extras::repo::redhat::params::centos_mirror_url,
|
$centos_mirror_url = $openstack_extras::repo::redhat::params::centos_mirror_url,
|
||||||
$update_packages = false,
|
$update_packages = false,
|
||||||
|
$update_timeout = 600,
|
||||||
) inherits openstack_extras::repo::redhat::params {
|
) inherits openstack_extras::repo::redhat::params {
|
||||||
|
|
||||||
validate_legacy(String, 'validate_string', $release)
|
validate_legacy(String, 'validate_string', $release)
|
||||||
@ -181,7 +186,7 @@ class openstack_extras::repo::redhat::redhat (
|
|||||||
exec { 'yum_update':
|
exec { 'yum_update':
|
||||||
command => '/usr/bin/dnf update -y',
|
command => '/usr/bin/dnf update -y',
|
||||||
refreshonly => true,
|
refreshonly => true,
|
||||||
timeout => 600,
|
timeout => $update_timeout,
|
||||||
}
|
}
|
||||||
|
|
||||||
Exec['yum_refresh'] ~> Exec['yum_update'] -> Package <||>
|
Exec['yum_refresh'] ~> Exec['yum_update'] -> Package <||>
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``openstack_extras::repo::redhat::redhat::update_timeout``
|
||||||
|
parameter has been added. This allows tuning timeout for `yum update -y`
|
||||||
|
(or `dnf update -y`) command.
|
@ -87,6 +87,22 @@ describe 'openstack_extras::repo::redhat::redhat' do
|
|||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with update_timeout' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:update_packages => true,
|
||||||
|
:update_timeout => 1200,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
it { should contain_exec('yum_update').with(
|
||||||
|
:command => '/usr/bin/dnf update -y',
|
||||||
|
:refreshonly => true,
|
||||||
|
:timeout => 1200,
|
||||||
|
)}
|
||||||
|
end
|
||||||
|
|
||||||
context 'with overridden release' do
|
context 'with overridden release' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user