From: Thomas Spalinger Date: Tue, 25 Jun 2013 20:53:14 +0000 (+0200) Subject: Merge branch 'master' into my_changes X-Git-Tag: 1.2.0~2^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ca810b37c67eae10995df645327699d2fea4b3ef;hp=7b5d30ed18ada02e46dd65c01c66a8dbd5bfed77;p=puppet-modules%2Fpuppetlabs-apt.git Merge branch 'master' into my_changes --- diff --git a/.gitignore b/.gitignore index d0aec6d..b77434b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.swp pkg/ Gemfile.lock +spec/fixtures/manifests diff --git a/.travis.yml b/.travis.yml index 8f713e0..a19074d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,10 +10,13 @@ env: - PUPPET_GEM_VERSION="~> 2.7.0" - PUPPET_GEM_VERSION="~> 3.0.0" - PUPPET_GEM_VERSION="~> 3.1.0" + - PUPPET_GEM_VERSION="~> 3.2.0" matrix: - allow_failures: - - rvm: ruby-head exclude: + - rvm: ruby-head + env: PUPPET_GEM_VERSION="~> 3.0.0" + - rvm: ruby-head + env: PUPPET_GEM_VERSION="~> 3.1.0" - rvm: 1.9.3 env: PUPPET_GEM_VERSION="~> 2.7.0" - rvm: ruby-head diff --git a/README.md b/README.md index c6d3915..5082e34 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,9 @@ Adds a ppa repository using `add-apt-repository`. Sets the default apt release. This class is particularly useful when using repositories, like Debian, that are unstable in Ubuntu. - apt::release { 'karmic': } + class { 'apt::release': + release_id => 'precise', + } ###apt::source diff --git a/manifests/init.pp b/manifests/init.pp index b8e356c..2319771 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -99,12 +99,16 @@ class apt( default: { fail('Valid values for disable_keys are true or false') } } - 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'], - } + $proxy_set = $proxy_host ? { + false => absent, + default => present + } + + file { 'configure-apt-proxy': + path => "${apt_conf_d}/proxy", + content => "Acquire::http::Proxy \"http://${proxy_host}:${proxy_port}\";", + notify => Exec['apt_update'], + ensure => $proxy_set, } # Need anchor to provide containment for dependencies. diff --git a/spec/classes/apt_spec.rb b/spec/classes/apt_spec.rb index d623a5b..a66feac 100644 --- a/spec/classes/apt_spec.rb +++ b/spec/classes/apt_spec.rb @@ -120,7 +120,11 @@ describe 'apt', :type => :class do 'notify' => "Exec[apt_update]" ) else - should_not contain_file('configure_apt_proxy') + should contain_file('configure-apt-proxy').with( + 'path' => '/etc/apt/apt.conf.d/proxy', + 'notify' => 'Exec[apt_update]', + 'ensure' => 'absent' + ) end } end diff --git a/spec/fixtures/manifests/site.pp b/spec/fixtures/manifests/site.pp deleted file mode 100644 index e69de29..0000000 diff --git a/templates/pin.pref.erb b/templates/pin.pref.erb index 74b9265..74df8b7 100644 --- a/templates/pin.pref.erb +++ b/templates/pin.pref.erb @@ -1,5 +1,5 @@ -# <%= name %> -Explanation: <%= explanation %> -Package: <%= packages %> -Pin: <%= pin %> -Pin-Priority: <%= priority %> +# <%= @name %> +Explanation: <%= @explanation %> +Package: <%= @packages %> +Pin: <%= @pin %> +Pin-Priority: <%= @priority %> diff --git a/templates/source.list.erb b/templates/source.list.erb index faa7e28..65764b2 100644 --- a/templates/source.list.erb +++ b/templates/source.list.erb @@ -1,5 +1,5 @@ -# <%= name %> -deb <%= location %> <%= release_real %> <%= repos %> -<%- if include_src then -%> -deb-src <%= location %> <%= release_real %> <%= repos %> +# <%= @name %> +deb <%= @location %> <%= @release_real %> <%= @repos %> +<%- if @include_src then -%> +deb-src <%= @location %> <%= @release_real %> <%= @repos %> <%- end -%>