Update hold.pp
authorwilman0 <mangano@sms.de>
Fri, 18 Jul 2014 08:51:32 +0000 (10:51 +0200)
committermangano <mangano@tjure-mac.netzquadrat.de>
Thu, 31 Jul 2014 16:40:46 +0000 (18:40 +0200)
fix for default debian installations

all files in /etc/apt/preferences without _ will be silently ignore according to debian manpage. Addionally its not a good idea to write versionnumber in filename cause there is no way to delete this files if you increase versionumber

Update source_spec.rb

add a way to include debsrc only (useful for debian/ubuntu build server ... jenkins ect)

Update source_spec.rb

var rename

Update source.list.erb

add include_deb "switch"

Update source.pp

"include_deb" defaultvalue = true

Update hold_spec.rb

change the name of the preferences file (hold)

Update source_spec.rb

Update README.md

Doku: 'include_deb' included next to 'include_src' in examples

Update README.md

typo

README.md
manifests/hold.pp
manifests/source.pp
spec/defines/hold_spec.rb
spec/defines/source_spec.rb
templates/source.list.erb

index 0749cb85af247cb6b784fb3a512fee343c9cfbd8..9f3bbbe7b762d13417c70eab8f0af4c78830974e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -202,7 +202,8 @@ Adds an apt source to `/etc/apt/sources.list.d/`.
       key               => '46925553',
       key_server        => 'subkeys.pgp.net',
       pin               => '-10',
-      include_src       => true
+      include_src       => true,
+      include_deb       => true
     }
 
 If you would like to configure your system so the source is the Puppet Labs APT repository
@@ -234,6 +235,7 @@ apt::sources:
       key_server: 'subkeys.pgp.net'
       pin: '-10'
       include_src: 'true'
+      include_deb: 'true'
 
   'puppetlabs':
       location: 'http://apt.puppetlabs.com'
index c4016c6e34ba609439dbe0d403edbd9abfec2c7a..61e8afcb3b572f4a6998bc9d1b4e9f4d66d50828 100644 (file)
@@ -40,13 +40,13 @@ define apt::hold(
   }
 
   if $ensure == 'present' {
-    ::apt::pin { "hold ${package} at ${version}":
+    ::apt::pin { "hold_${package}":
       packages => $package,
       version  => $version,
       priority => $priority,
     }
   } else {
-    ::apt::pin { "hold ${package} at ${version}":
+    ::apt::pin { "hold_${package}":
       ensure => 'absent',
     }
   }
index dd00adc6a4e62a6943cc5f0368596bd4d7c7ff4d..259d0ebb98993d26eacd83ce9db9cce2ac9012b3 100644 (file)
@@ -8,6 +8,7 @@ define apt::source(
   $release           = 'UNDEF',
   $repos             = 'main',
   $include_src       = true,
+  $include_deb       = true,
   $required_packages = false,
   $key               = undef,
   $key_server        = 'keyserver.ubuntu.com',
index 731e218d84bc3dbf6e86838b2fda6874aa5871cb..9da21d784a9b634016bd49e3a2cebee9a2a94d08 100644 (file)
@@ -25,7 +25,7 @@ describe 'apt::hold' do
         :priority => 1001,
       })
 
-      should contain_apt__pin("hold #{title} at #{params[:version]}").with({
+      should contain_apt__pin("hold_#{title}").with({
         :ensure   => 'present',
         :packages => title,
         :version  => params[:version],
@@ -42,7 +42,7 @@ describe 'apt::hold' do
         :ensure   => params[:ensure],
       })
 
-      should contain_apt__pin("hold #{title} at #{params[:version]}").with({
+      should contain_apt__pin("hold_#{title}").with({
         :ensure   => params[:ensure],
       })
     end
@@ -59,7 +59,7 @@ describe 'apt::hold' do
         :priority => params[:priority],
       })
 
-      should contain_apt__pin("hold #{title} at #{params[:version]}").with({
+      should contain_apt__pin("hold_#{title}").with({
         :ensure   => 'present',
         :packages => title,
         :version  => params[:version],
index 7c7ae399e84768fe3d51daca47c67a49c35b8855..284adca27fe4496413607bdc0b638b127ee8d858 100644 (file)
@@ -15,6 +15,7 @@ describe 'apt::source', :type => :define do
       :release            => 'karmic',
       :repos              => 'main',
       :include_src        => true,
+      :include_deb        => true,
       :required_packages  => false,
       :key                => false,
       :key_server         => false,
@@ -83,8 +84,9 @@ describe 'apt::source', :type => :define do
         if param_hash[:architecture]
           arch = "[arch=#{param_hash[:architecture]}] "
         end
-        content << "\ndeb #{arch}#{param_hash[:location]} #{param_hash[:release]} #{param_hash[:repos]}\n"
-
+        if param_hash[:include_deb]
+         content << "\ndeb #{arch}#{param_hash[:location]} #{param_hash[:release]} #{param_hash[:repos]}\n"
+       end
         if param_hash[:include_src]
           content << "deb-src #{arch}#{param_hash[:location]} #{param_hash[:release]} #{param_hash[:repos]}\n"
         end
index a57244fce81e61be50470cdbdd7c39c741468312..01b2176a6ea5d0d357cb37444e4def4067111eb3 100644 (file)
@@ -1,6 +1,8 @@
 #file generated by puppet
 # <%= @comment %>
+<%- if @include_deb then -%>
 deb <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
+<%- end -%>
 <%- if @include_src then -%>
 deb-src <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
 <%- end -%>