aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-05-11 10:49:27 -0400
committerJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>2015-05-11 12:01:35 -0400
commitd007a403330c553d925b1b4888d93962a5f83f99 (patch)
tree005b4ef8a8fc558a6cb143b3252e8694eada215c /templates
parent87bfb868d7625100086a26a81743f5adbabbb988 (diff)
downloadpuppet-apt-d007a403330c553d925b1b4888d93962a5f83f99.tar.gz
puppet-apt-d007a403330c553d925b1b4888d93962a5f83f99.tar.bz2
Replace debian_*() parser functions with facts
* Removes dependency on lsb-release and/or Facter >1.7 (values are based on $::lsbdistcodename, when available) * Simplifies maintenance: only lib/facter/util/* require updates as new releases are made Caveats: * apt::codename is removed; to override debian_* facts, set the FACTER_debian_codename environment variable for puppet * If tracking unstable, make sure lsb-release is installed, as other methods can't tell between testing and unstable
Diffstat (limited to 'templates')
-rw-r--r--templates/50unattended-upgrades.erb4
-rw-r--r--templates/Debian/preferences_jessie.erb2
-rw-r--r--templates/Debian/preferences_lenny.erb6
-rw-r--r--templates/Debian/preferences_squeeze.erb4
-rw-r--r--templates/Debian/preferences_wheezy.erb2
-rw-r--r--templates/Debian/sources.list.erb8
-rw-r--r--templates/Ubuntu/preferences_maverick.erb4
-rw-r--r--templates/Ubuntu/sources.list.erb2
8 files changed, 16 insertions, 16 deletions
diff --git a/templates/50unattended-upgrades.erb b/templates/50unattended-upgrades.erb
index 23c5c89..2afebfe 100644
--- a/templates/50unattended-upgrades.erb
+++ b/templates/50unattended-upgrades.erb
@@ -5,13 +5,13 @@ Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}-security";
"${distro_id}:${distro_codename}-updates";
"${distro_id}:${distro_codename}-backports";
-<% elsif scope.lookupvar('::operatingsystem') == 'Debian' and scope.lookupvar('::operatingsystemmajrelease') == 6 -%>
+<% elsif scope.lookupvar('::operatingsystem') == 'Debian' and scope.lookupvar('::debian_codename') == 'squeeze' -%>
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:oldoldstable";
"${distro_id}:squeeze-lts";
<% else -%>
Unattended-Upgrade::Origins-Pattern {
- "origin=Debian,archive=<%= scope.lookupvar('::apt::release') %>,label=Debian-Security";
+ "origin=Debian,archive=<%= scope.lookupvar('::debian_release') %>,label=Debian-Security";
"origin=Debian,archive=${distro_codename}-lts";
<% end -%>
};
diff --git a/templates/Debian/preferences_jessie.erb b/templates/Debian/preferences_jessie.erb
index 4f8e95c..0888abe 100644
--- a/templates/Debian/preferences_jessie.erb
+++ b/templates/Debian/preferences_jessie.erb
@@ -1,4 +1,4 @@
-Explanation: Debian <%= codename=scope.lookupvar('apt::codename') %>
+Explanation: Debian <%= codename=scope.lookupvar('::debian_codename') %>
Package: *
Pin: release o=Debian,n=<%= codename %>
Pin-Priority: 990
diff --git a/templates/Debian/preferences_lenny.erb b/templates/Debian/preferences_lenny.erb
index 5c3c829..6500168 100644
--- a/templates/Debian/preferences_lenny.erb
+++ b/templates/Debian/preferences_lenny.erb
@@ -1,6 +1,6 @@
-Explanation: Debian <%= codename=scope.lookupvar('apt::codename') %>
+Explanation: Debian <%= codename=scope.lookupvar('::debian_codename') %>
Package: *
-Pin: release o=Debian,a=<%= scope.lookupvar('apt::release') %>,v=<%= scope.lookupvar('apt::release_version') %>*
+Pin: release o=Debian,a=<%= scope.lookupvar('::debian_release') %>,v=5*
Pin-Priority: 990
Explanation: Debian backports
@@ -8,7 +8,7 @@ Package: *
Pin: origin backports.debian.org
Pin-Priority: 200
-Explanation: Debian <%= next_release=scope.lookupvar('apt::next_release') %>
+Explanation: Debian <%= next_release=scope.lookupvar('::debian_nextrelease') %>
Package: *
Pin: release o=Debian,a=<%= next_release %>
Pin-Priority: 2
diff --git a/templates/Debian/preferences_squeeze.erb b/templates/Debian/preferences_squeeze.erb
index 838b3a1..885edc7 100644
--- a/templates/Debian/preferences_squeeze.erb
+++ b/templates/Debian/preferences_squeeze.erb
@@ -1,4 +1,4 @@
-Explanation: Debian <%= codename=scope.lookupvar('apt::codename') %>
+Explanation: Debian <%= codename=scope.lookupvar('::debian_codename') %>
Package: *
Pin: release o=Debian,n=<%= codename %>
Pin-Priority: 990
@@ -13,7 +13,7 @@ Package: *
Pin: release o=Debian,n=<%= codename %>-lts
Pin-Priority: 990
-Explanation: Debian <%= next_codename=scope.lookupvar('apt::next_codename') %>
+Explanation: Debian <%= next_codename=scope.lookupvar('::debian_nextcodename') %>
Package: *
Pin: release o=Debian,n=<%= next_codename %>
Pin-Priority: 2
diff --git a/templates/Debian/preferences_wheezy.erb b/templates/Debian/preferences_wheezy.erb
index 0cc0e5c..106108d 100644
--- a/templates/Debian/preferences_wheezy.erb
+++ b/templates/Debian/preferences_wheezy.erb
@@ -1,4 +1,4 @@
-Explanation: Debian <%= codename=scope.lookupvar('apt::codename') %>
+Explanation: Debian <%= codename=scope.lookupvar('::debian_codename') %>
Package: *
Pin: release o=Debian,n=<%= codename %>
Pin-Priority: 990
diff --git a/templates/Debian/sources.list.erb b/templates/Debian/sources.list.erb
index d043b70..8629626 100644
--- a/templates/Debian/sources.list.erb
+++ b/templates/Debian/sources.list.erb
@@ -1,7 +1,7 @@
# This file is managed by puppet
# all local modifications will be overwritten
-### Debian current: <%= codename=scope.lookupvar('apt::codename') %>
+### Debian current: <%= codename=scope.lookupvar('::debian_codename') %>
# basic
deb <%= debian_url=scope.lookupvar('apt::debian_url') %> <%= codename %> <%= lrepos=scope.lookupvar('apt::real_repos') %>
@@ -10,7 +10,7 @@ deb-src <%= debian_url %> <%= codename %> <%= lrepos %>
<% end -%>
# security
-<% if ((release=scope.lookupvar('apt::release')) == "stable" || release == "oldstable") -%>
+<% if ((release=scope.lookupvar('::debian_release')) == "stable" || release == "oldstable") -%>
deb <%= security_url=scope.lookupvar('apt::security_url') %> <%= codename %>/updates <%= lrepos %>
<% if include_src -%>
deb-src <%= security_url %> <%= codename %>/updates <%= lrepos %>
@@ -43,7 +43,7 @@ deb-src <%= debian_url %> <%= codename %>-updates <%= lrepos %>
<% if use_lts=scope.lookupvar('apt::use_lts') -%>
# LTS
-<% if release != "oldoldstable" -%>
+<% if release_lts=scope.lookupvar('::debian_lts') == "false" -%>
# There is no LTS archive for <%= release %>
<% else -%>
deb <%= debian_url %> <%= codename %>-lts <%= lrepos %>
@@ -54,7 +54,7 @@ deb-src <%= debian_url %> <%= codename %>-lts <%= lrepos %>
<% end -%>
<% if next_release=scope.lookupvar('apt::use_next_release') -%>
-### Debian next: <%= next_release=scope.lookupvar('apt::next_release') ; next_codename=scope.lookupvar('apt::next_codename') %>
+### Debian next: <%= next_release=scope.lookupvar('::debian_nextrelease') ; next_codename=scope.lookupvar('::debian_nextcodename') %>
# basic
deb <%= debian_url %> <%= next_codename %> <%= lrepos %>
diff --git a/templates/Ubuntu/preferences_maverick.erb b/templates/Ubuntu/preferences_maverick.erb
index 801ddd4..8e5481d 100644
--- a/templates/Ubuntu/preferences_maverick.erb
+++ b/templates/Ubuntu/preferences_maverick.erb
@@ -1,4 +1,4 @@
-Explanation: Ubuntu <%= codename=scope.lookupvar('apt::codename') %> security
+Explanation: Ubuntu <%= codename=scope.lookupvar('::ubuntu_codename') %> security
Package: *
Pin: release o=Ubuntu,a=<%= codename %>-security
Pin-Priority: 990
@@ -18,7 +18,7 @@ Package: *
Pin: release a=<%= codename %>-backports
Pin-Priority: 200
-Explanation: Ubuntu <%= next_release=scope.lookupvar('apt::next_release') %>
+Explanation: Ubuntu <%= next_release=scope.lookupvar('::ubuntu_nextcodename') %>
Package: *
Pin: release o=Ubuntu,a=<%= next_release %>
Pin-Priority: 2
diff --git a/templates/Ubuntu/sources.list.erb b/templates/Ubuntu/sources.list.erb
index 8d2585d..e68399b 100644
--- a/templates/Ubuntu/sources.list.erb
+++ b/templates/Ubuntu/sources.list.erb
@@ -1,7 +1,7 @@
# This file is managed by puppet
# all local modifications will be overwritten
-# basic <%= codename=scope.lookupvar('apt::codename') %>
+# basic <%= codename=scope.lookupvar('::ubuntu_codename') %>
deb <%= ubuntu_url=scope.lookupvar('apt::ubuntu_url') %> <%= codename %> <%= lrepos=scope.lookupvar('apt::real_repos') %>
<% if include_src=scope.lookupvar('apt::include_src') -%>
deb-src <%= ubuntu_url %> <%= codename %> <%= lrepos %>