Skip to content

Commit

Permalink
Merge pull request #41 from tbroyer/install-proxy-first
Browse files Browse the repository at this point in the history
Make sure we configure the proxy before doing apt-get update.
  • Loading branch information
nanliu committed May 3, 2012
2 parents 4a788a6 + e656c65 commit 51a7596
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@
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'],
}
}
}
3 changes: 2 additions & 1 deletion spec/classes/apt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
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')
Expand Down

0 comments on commit 51a7596

Please sign in to comment.