Allow custom comment for sources list

This commit is contained in:
juniorsysadmin 2014-06-10 16:42:06 +10:00
parent 4929de0d42
commit 986bf8b02d
3 changed files with 8 additions and 2 deletions

View file

@ -2,6 +2,7 @@
# add an apt source
define apt::source(
$comment = $name,
$ensure = present,
$location = '',
$release = 'UNDEF',

View 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

View 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 %>