Merge pull request #311 from juniorsysadmin/custom-comment-for-sources-list
Allow for custom comment in sources.list file
This commit is contained in:
commit
bcd1a8d53c
3 changed files with 8 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
# add an apt source
|
# add an apt source
|
||||||
|
|
||||||
define apt::source(
|
define apt::source(
|
||||||
|
$comment = $name,
|
||||||
$ensure = present,
|
$ensure = present,
|
||||||
$location = '',
|
$location = '',
|
||||||
$release = 'UNDEF',
|
$release = 'UNDEF',
|
||||||
|
|
|
@ -74,7 +74,12 @@ describe 'apt::source', :type => :define do
|
||||||
end
|
end
|
||||||
|
|
||||||
let :content do
|
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]
|
if param_hash[:architecture]
|
||||||
arch = "[arch=#{param_hash[:architecture]}] "
|
arch = "[arch=#{param_hash[:architecture]}] "
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#file generated by puppet
|
#file generated by puppet
|
||||||
# <%= @name %>
|
# <%= @comment %>
|
||||||
deb <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
|
deb <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
|
||||||
<%- if @include_src then -%>
|
<%- if @include_src then -%>
|
||||||
deb-src <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
|
deb-src <% if @architecture %>[arch=<%= @architecture %>] <% end %><%= @location %> <%= @release_real %> <%= @repos %>
|
||||||
|
|
Loading…
Reference in a new issue