Skip to content

Commit

Permalink
Make sure we configure the proxy before doing apt-get update.
Browse files Browse the repository at this point in the history
  • Loading branch information
tbroyer committed Mar 30, 2012
1 parent 482609f commit e656c65
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 @@ -87,10 +87,11 @@
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'],
}
}
}
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 e656c65

Please sign in to comment.