aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README8
-rw-r--r--manifests/init.pp15
-rw-r--r--templates/sources.list.erb12
3 files changed, 30 insertions, 5 deletions
diff --git a/README b/README
index 22de451..b1f98c6 100644
--- a/README
+++ b/README
@@ -83,6 +83,14 @@ If this variable is set to true the Debian Volatile sources are added.
By default this is false for backward compatibility with older
versions of this module.
+$apt_include_src
+----------------
+
+If this variable is set to true a deb-src source is added for every
+added binary archive source.
+By default this is false for backward compatibility with older
+versions of this module.
+
Classes
=======
diff --git a/manifests/init.pp b/manifests/init.pp
index d79e79a..7f52a9c 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -11,16 +11,21 @@ class apt {
default => $apt_clean,
}
- package { apt:
- ensure => installed,
- require => undef,
- }
-
$use_volatile = $apt_use_volatile ? {
'' => false,
default => $apt_use_volatile,
}
+ $include_src = $apt_include_src ? {
+ '' => false,
+ default => $apt_include_src,
+ }
+
+ package { apt:
+ ensure => installed,
+ require => undef,
+ }
+
# init $release, $next_release, $codename, $next_codename
case $lsbdistcodename {
'': {
diff --git a/templates/sources.list.erb b/templates/sources.list.erb
index d3739ff..35fac32 100644
--- a/templates/sources.list.erb
+++ b/templates/sources.list.erb
@@ -4,12 +4,18 @@
# basic
deb <%= http://ftp.debian.org/debian/ %> <%= codename %> <%= repos %>
+<% if include_src then %>
+deb-src <%= http://ftp.debian.org/debian/ %> <%= codename %> <%= repos %>
+<% end %>
# security
<% if (release == "unstable" || release == "experimental") %>
# There is no security support for <%= release %>
<% else %>
deb http://security.debian.org/ <%= codename %>/updates <%= repos %>
+<% if include_src then %>
+deb-src http://security.debian.org/ <%= codename %>/updates <%= repos %>
+<% end %>
<% end %>
# backports
@@ -17,6 +23,9 @@ deb http://security.debian.org/ <%= codename %>/updates <%= repos %>
# There is no backports archive for <%= release %>
<% else %>
deb http://backports.debian.org/debian-backports/ <%= codename %>-backports <%= repos %>
+<% if include_src then %>
+deb-src http://backports.debian.org/debian-backports/ <%= codename %>-backports <%= repos %>
+<% end %>
<% end %>
<% if use_volatile %>
@@ -25,6 +34,9 @@ deb http://backports.debian.org/debian-backports/ <%= codename %>-backports <%=
# There is no volatile archive for <%= release %>
<% else %>
deb http://volatile.debian.org/debian-volatile/ <%= codename %>/volatile <%= repos %>
+<% if include_src then %>
+deb-src http://volatile.debian.org/debian-volatile/ <%= codename %>/volatile <%= repos %>
+<% end %>
<% end %>
<% end %>