]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Allow custom comment for sources list
authorjuniorsysadmin <juniorsysadmin@users.noreply.github.com>
Tue, 10 Jun 2014 06:42:06 +0000 (16:42 +1000)
committerjuniorsysadmin <juniorsysadmin@users.noreply.github.com>
Tue, 10 Jun 2014 07:05:51 +0000 (17:05 +1000)
manifests/source.pp
spec/defines/source_spec.rb
templates/source.list.erb

index 196fc925866435dec0a3b038c8b65054542ea84e..dd00adc6a4e62a6943cc5f0368596bd4d7c7ff4d 100644 (file)
@@ -2,6 +2,7 @@
 # add an apt source
 
 define apt::source(
+  $comment           = $name,
   $ensure            = present,
   $location          = '',
   $release           = 'UNDEF',
index bf5e50e401286d58a44fc1c63ef2cbd6a2b0ce25..7c7ae399e84768fe3d51daca47c67a49c35b8855 100644 (file)
@@ -74,7 +74,12 @@ describe 'apt::source', :type => :define do
       end
 
       let :content do
-        content = "#file generated by puppet\n# #{title}"
+        content = "#file generated by puppet\n"
+       if param_hash[:comment]
+         content << "# #{comment}"
+       else
+         content << "# #{title}"
+       end
         if param_hash[:architecture]
           arch = "[arch=#{param_hash[:architecture]}] "
         end
index 541534e65bd8a383844e9e2d172a4a23ed43feb7..a57244fce81e61be50470cdbdd7c39c741468312 100644 (file)
@@ -1,5 +1,5 @@
 #file generated by puppet
-# <%= @name %>
+# <%= @comment %>
 deb <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
 <%- if @include_src then -%>
 deb-src <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>