From eb40a7ae7822bfea30e8e95fb1108676192a8541 Mon Sep 17 00:00:00 2001 From: Henrik Ahlgren Date: Fri, 10 Jan 2014 17:09:18 +0200 Subject: [PATCH] Make apt.conf.d/proxy world readable and add a newline --- manifests/init.pp | 5 ++++- spec/classes/apt_spec.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 12db61a..b0621fe 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -128,8 +128,11 @@ Package: bogus-package\n", file { 'configure-apt-proxy': ensure => $proxy_set, path => "${apt_conf_d}/proxy", - content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";", + content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";\n", notify => Exec['apt_update'], + mode => '0644', + owner => root, + group => root, } # Need anchor to provide containment for dependencies. diff --git a/spec/classes/apt_spec.rb b/spec/classes/apt_spec.rb index 0da7d32..7f88ddd 100644 --- a/spec/classes/apt_spec.rb +++ b/spec/classes/apt_spec.rb @@ -164,7 +164,7 @@ 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]}\";\n", 'notify' => "Exec[apt_update]" ) else -- 2.32.3