]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
(#16076) Ability to fill in pin explanation
authorErik Dalén <dalen@spotify.com>
Wed, 22 Aug 2012 08:22:21 +0000 (10:22 +0200)
committerErik Dalén <dalen@spotify.com>
Thu, 25 Oct 2012 19:44:20 +0000 (15:44 -0400)
Adds the ability to fill it in and sets a reasonable default.

manifests/pin.pp
spec/defines/pin_spec.rb
templates/pin.pref.erb

index cebc6e7b0da2c390092324ad7c32c5e236dab641..21cc3ffdefc0294c0c91c37de474971b94b26869 100644 (file)
@@ -3,6 +3,7 @@
 
 define apt::pin(
   $ensure     = present,
+  $explanation = "${::caller_module_name}: ${name}",
   $order      = '',
   $packages   = '*',
   $priority   = 0,
index cd269d3b8bb11b3deff3831df99be63b5d877da8..3aaf49cef494e79f3b4fce0c2e2e02ba91d7915d 100644 (file)
@@ -50,7 +50,7 @@ describe 'apt::pin', :type => :define do
           'owner'   => 'root',
           'group'   => 'root',
           'mode'    => '0644',
-          'content' => "# #{title}\nPackage: #{param_hash[:packages]}\nPin: release a=#{param_hash[:release] || title}\nPin-Priority: #{param_hash[:priority]}\n",
+          'content' => "# #{title}\nExplanation: : #{title}\nPackage: #{param_hash[:packages]}\nPin: release a=#{param_hash[:release] || title}\nPin-Priority: #{param_hash[:priority]}\n",
         })
       }
     end
index 9a1e690ee66b49254e14f63aa265396460ec6d53..74b92659b87352db11945d7e1cd07971c1ec2613 100644 (file)
@@ -1,4 +1,5 @@
 # <%= name %>
+Explanation: <%= explanation %>
 Package: <%= packages %>
 Pin: <%= pin %>
 Pin-Priority: <%= priority %>