]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Make sure we configure the proxy before doing apt-get update.
authorThomas Broyer <t.broyer@ltgt.net>
Fri, 30 Mar 2012 15:48:31 +0000 (17:48 +0200)
committerThomas Broyer <t.broyer@ltgt.net>
Fri, 30 Mar 2012 15:48:31 +0000 (17:48 +0200)
manifests/init.pp
spec/classes/apt_spec.rb

index 29db697c14c104ef3963de0141586a9e3ec66582..ba53fd2a23f2f04fd163b0cc0532b6355c180971 100644 (file)
@@ -87,10 +87,11 @@ class apt(
     default: { fail('Valid values for disable_keys are true or false') }
   }
 
-  if($proxy_host) {
+  if ($proxy_host) {
     file { 'configure-apt-proxy':
       path    => '/etc/apt/apt.conf.d/proxy',
       content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";",
+      notify  => Exec['apt_update'],
     }
   }
 }
index 000793d092783a3740be5cca53e4518bd2fe819a..079bd59c5b58f8828122f0270aa671deb8b15b28 100644 (file)
@@ -117,7 +117,8 @@ describe 'apt', :type => :class do
           if param_hash[:proxy_host]
             should contain_file('configure-apt-proxy').with(
               'path'    => '/etc/apt/apt.conf.d/proxy',
-              'content' => "Acquire::http::Proxy \"http://#{param_hash[:proxy_host]}:#{param_hash[:proxy_port]}\";"
+              'content' => "Acquire::http::Proxy \"http://#{param_hash[:proxy_host]}:#{param_hash[:proxy_port]}\";",
+              'notify'  => "Exec[apt_update]"
             )
           else
             should_not contain_file('configure_apt_proxy')