default => present
}
- file { 'configure-apt-proxy':
+ file { '01proxy':
ensure => $proxy_set,
- path => "${apt_conf_d}/proxy",
+ path => "${apt_conf_d}/01proxy",
content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";\n",
notify => Exec['apt_update'],
mode => '0644',
owner => root,
group => root,
}
+
+ file { 'old-proxy-file':
+ ensure => absent,
+ path => "${apt_conf_d}/proxy",
+ notify => Exec['apt_update'],
+ }
# Need anchor to provide containment for dependencies.
anchor { 'apt::update':
apply_manifest(pp, :catch_failures => true)
end
- describe file('/etc/apt/apt.conf.d/proxy') do
+ describe file('/etc/apt/apt.conf.d/01proxy') do
it { should be_file }
it { should contain 'Acquire::http::Proxy "http://localhost:7042\";' }
end
+ describe file('/etc/apt/apt.conf.d/proxy') do
+ it { should_not be_file }
+ end
end
context 'purge_sources' do
apply_manifest(pp, :catch_failures => true)
end
- describe file('/etc/apt/apt.conf.d/proxy') do
+ describe file('/etc/apt/apt.conf.d/01proxy') do
it { should be_file }
it { should contain 'Acquire::http::Proxy "http://localhost:7042\";' }
end
+ describe file('/etc/apt/apt.conf.d/proxy') do
+ it { should_not be_file }
+ end
end
context 'purge_sources' do
describe 'when setting a proxy' do
it {
if param_hash[:proxy_host]
- should contain_file('configure-apt-proxy').with(
- 'path' => '/etc/apt/apt.conf.d/proxy',
+ should contain_file('01proxy').with(
+ 'path' => '/etc/apt/apt.conf.d/01proxy',
'content' => "Acquire::http::Proxy \"http://#{param_hash[:proxy_host]}:#{param_hash[:proxy_port]}\";\n",
'notify' => "Exec[apt_update]"
)
else
- should contain_file('configure-apt-proxy').with(
- 'path' => '/etc/apt/apt.conf.d/proxy',
+ should contain_file('01proxy').with(
+ 'path' => '/etc/apt/apt.conf.d/01proxy',
'notify' => 'Exec[apt_update]',
'ensure' => 'absent'
)