Skip to content

Commit

Permalink
Merge pull request #311 from juniorsysadmin/custom-comment-for-source…
Browse files Browse the repository at this point in the history
…s-list

Allow for custom comment in sources.list file
  • Loading branch information
Morgan Haskel committed Jun 19, 2014
2 parents 4929de0 + 986bf8b commit bcd1a8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions manifests/source.pp
Expand Up @@ -2,6 +2,7 @@
# add an apt source

define apt::source(
$comment = $name,
$ensure = present,
$location = '',
$release = 'UNDEF',
Expand Down
7 changes: 6 additions & 1 deletion spec/defines/source_spec.rb
Expand Up @@ -74,7 +74,12 @@
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
Expand Down
2 changes: 1 addition & 1 deletion templates/source.list.erb
@@ -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 %>
Expand Down

0 comments on commit bcd1a8d

Please sign in to comment.