From 5ea69cb0390deac15d57aefc361a895a0c9a6e96 Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Tue, 9 Jun 2015 11:25:34 -0400 Subject: allow possibility of disabling backports --- manifests/init.pp | 1 + manifests/params.pp | 1 + templates/Debian/sources.list.erb | 10 ++++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 68856cc..062be4c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -7,6 +7,7 @@ class apt( $codename = $apt::params::codename, $use_lts = $apt::params::use_lts, $use_volatile = $apt::params::use_volatile, + $use_backports = $apt::params::use_backports, $include_src = $apt::params::include_src, $use_next_release = $apt::params::use_next_release, $debian_url = $apt::params::debian_url, diff --git a/manifests/params.pp b/manifests/params.pp index f977c27..a1c7392 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,6 +2,7 @@ class apt::params () { $codename = $::lsbdistcodename $use_lts = false $use_volatile = false + $use_backports = true $include_src = false $use_next_release = false $debian_url = 'http://httpredir.debian.org/debian/' diff --git a/templates/Debian/sources.list.erb b/templates/Debian/sources.list.erb index d043b70..a19893d 100644 --- a/templates/Debian/sources.list.erb +++ b/templates/Debian/sources.list.erb @@ -19,14 +19,16 @@ deb-src <%= security_url %> <%= codename %>/updates <%= lrepos %> # There is no security support for <%= release %> <% end -%> +<% if use_volatile=scope.lookupvar('apt::use_backports') -%> # backports -<% if (release == "testing" || release == "unstable" || release == "experimental") -%> +<% if (release == "testing" || release == "unstable" || release == "experimental") -%> # There is no backports archive for <%= release %> -<% else -%> +<% else -%> deb <%= backports_url=scope.lookupvar('apt::backports_url') %> <%= codename %>-backports <%= lrepos %> -<% if include_src -%> +<% if include_src -%> deb-src <%= backports_url %> <%= codename %>-backports <%= lrepos %> -<% end +<% end + end end -%> <% if use_volatile=scope.lookupvar('apt::use_volatile') -%> -- cgit v1.2.3 From dbee5c9487c8d06f27f1a3bb17f70bf870490258 Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Tue, 9 Jun 2015 11:28:54 -0400 Subject: typo --- templates/Debian/sources.list.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Debian/sources.list.erb b/templates/Debian/sources.list.erb index a19893d..ce43135 100644 --- a/templates/Debian/sources.list.erb +++ b/templates/Debian/sources.list.erb @@ -19,7 +19,7 @@ deb-src <%= security_url %> <%= codename %>/updates <%= lrepos %> # There is no security support for <%= release %> <% end -%> -<% if use_volatile=scope.lookupvar('apt::use_backports') -%> +<% if use_backports=scope.lookupvar('apt::use_backports') -%> # backports <% if (release == "testing" || release == "unstable" || release == "experimental") -%> # There is no backports archive for <%= release %> -- cgit v1.2.3 From 3da1db27075082603a862c8fd5c3c1396e062bc8 Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Tue, 9 Jun 2015 11:34:51 -0400 Subject: also control backports on ubuntu --- templates/Ubuntu/sources.list.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/Ubuntu/sources.list.erb b/templates/Ubuntu/sources.list.erb index 8d2585d..f3ef37c 100644 --- a/templates/Ubuntu/sources.list.erb +++ b/templates/Ubuntu/sources.list.erb @@ -19,8 +19,10 @@ deb <%= ubuntu_url %> <%= codename %>-security <%= lrepos %> deb-src <%= ubuntu_url %> <%= codename %>-security <%= lrepos %> <% end -%> +<% if use_backports=scope.lookupvar('apt::use_backports') -%> # backports deb <%= ubuntu_url %> <%= codename %>-backports <%= lrepos %> -<% if include_src -%> +<% if include_src -%> deb-src <%= ubuntu_url %> <%= codename %>-backports <%= lrepos %> -<% end -%> +<% end + end -%> -- cgit v1.2.3 From d87876a16fdf6cb710210b1a11572d553dec755a Mon Sep 17 00:00:00 2001 From: Antoine Beaupré Date: Tue, 9 Jun 2015 11:35:41 -0400 Subject: also disable volatile on ubuntu if relevant --- templates/Ubuntu/sources.list.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/Ubuntu/sources.list.erb b/templates/Ubuntu/sources.list.erb index f3ef37c..213f051 100644 --- a/templates/Ubuntu/sources.list.erb +++ b/templates/Ubuntu/sources.list.erb @@ -7,11 +7,13 @@ deb <%= ubuntu_url=scope.lookupvar('apt::ubuntu_url') %> <%= codename %> <%= lre deb-src <%= ubuntu_url %> <%= codename %> <%= lrepos %> <% end -%> +<% if use_volatile=scope.lookupvar('apt::use_volatile') -%> # updates deb <%= ubuntu_url %> <%= codename %>-updates <%= lrepos %> -<% if include_src -%> +<% if include_src -%> deb-src <%= ubuntu_url %> <%= codename %>-updates <%= lrepos %> -<% end -%> +<% end + end -%> # security suppport deb <%= ubuntu_url %> <%= codename %>-security <%= lrepos %> -- cgit v1.2.3