Merge branch 'master' into my_changes
authorThomas Spalinger <spali@github.com>
Tue, 25 Jun 2013 20:53:14 +0000 (22:53 +0200)
committerThomas Spalinger <spali@github.com>
Tue, 25 Jun 2013 20:53:14 +0000 (22:53 +0200)
.gitignore
.travis.yml
README.md
manifests/init.pp
spec/classes/apt_spec.rb
spec/fixtures/manifests/site.pp [deleted file]
templates/pin.pref.erb
templates/source.list.erb

index d0aec6d793bed7d48e3c8d12fba8f5bc3ae5ded2..b77434bea0792513cdff50c8759df47957f77965 100644 (file)
@@ -1,3 +1,4 @@
 *.swp
 pkg/
 Gemfile.lock
+spec/fixtures/manifests
index 8f713e06b8fb28bbc476f0ccbc3db93b5dd04e26..a19074d0b8412434d76d5d32f489c4210f9615e2 100644 (file)
@@ -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
index c6d39151cc7e4669c0f964a18af0b40a94cf01f3..5082e343376ca01fb5551e91fd12b3631682d9dd 100644 (file)
--- 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
 
index b8e356c53ae8a3aa09b7427a96065189b1389158..23197719500809e6b4d1e5c4b4aa5ad87fdf7feb 100644 (file)
@@ -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.
index d623a5bf7824f8c2d32ec0cc6322b9a23f83549f..a66feac78810ce3175580a2dd5ee4b7298fcd2ea 100644 (file)
@@ -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 (file)
index e69de29..0000000
index 74b92659b87352db11945d7e1cd07971c1ec2613..74df8b79c45b54b36400e7d942da2f67df6c9e4d 100644 (file)
@@ -1,5 +1,5 @@
-# <%= name %>
-Explanation: <%= explanation %>
-Package: <%= packages %>
-Pin: <%= pin %>
-Pin-Priority: <%= priority %>
+# <%= @name %>
+Explanation: <%= @explanation %>
+Package: <%= @packages %>
+Pin: <%= @pin %>
+Pin-Priority: <%= @priority %>
index faa7e286ece80cfafd89db734010328030b03c24..65764b2612cac71780f8cbef50cb2b2d9faaf9d6 100644 (file)
@@ -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 -%>