From c6ac49bb806cefbabc8ecc217726e9ad152ab470 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Mon, 14 Sep 2015 15:01:58 +0300 Subject: [PATCH] Reduce yum timeout inside containers Changed yum configuration inside Docker containers: * Reduced retries to 5 (was 10) * Reduced timeout to 5 (was 30) This enables containers to fail connections to external repositories if network connectivity is not working in uncommon situations where DNS works, but HTTP connections fail. Change-Id: I06e5514157ed7bf143ac3738fd7af23ba383fdaa Closes-Bug: #1494640 --- deployment/puppet/docker/manifests/container.pp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/deployment/puppet/docker/manifests/container.pp b/deployment/puppet/docker/manifests/container.pp index d6a9a38597..33ac600f31 100644 --- a/deployment/puppet/docker/manifests/container.pp +++ b/deployment/puppet/docker/manifests/container.pp @@ -1,5 +1,7 @@ class docker::container ( $tz = 'UTC', +$yum_retries = '5', +$yum_timeout = '5', $zoneinfo_dir = '/usr/share/zoneinfo', ) { @@ -9,5 +11,16 @@ $zoneinfo_dir = '/usr/share/zoneinfo', target => "${zoneinfo_dir}/${tz}" } } + file_line {'yum retries': + path => '/etc/yum.conf', + line => "retries=${yum_retries}", + after => '\[main\]', + } + + file_line {'yum timeout': + path => '/etc/yum.conf', + line => "timeout=${yum_timeout}", + after => '\[main\]', + } }