]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge pull request #41 from tbroyer/install-proxy-first
authorNan Liu <nan.liu@gmail.com>
Thu, 3 May 2012 00:31:57 +0000 (17:31 -0700)
committerNan Liu <nan.liu@gmail.com>
Thu, 3 May 2012 00:31:57 +0000 (17:31 -0700)
Make sure we configure the proxy before doing apt-get update.

manifests/init.pp
spec/classes/apt_spec.rb

index 3ea92ab1bfa584d0ce0ce83c0e7c5692f7437b7f..068fb497c4933d3e9d7fb6af925c0a0ab459a581 100644 (file)
@@ -93,10 +93,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    => "${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')