summaryrefslogtreecommitdiff
path: root/puppet/modules/apt/lib/facter/debian_nextrelease.rb
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-05-24 10:19:22 -0400
committerMicah <micah@leap.se>2016-05-24 10:19:22 -0400
commitd5e5d2f82a403fe507e7c58a6373d693f0906a1e (patch)
tree6ce4341b8b4c7fc78e53abab365afe069bf0d8ca /puppet/modules/apt/lib/facter/debian_nextrelease.rb
parent8166111831b79d426964440cd355d57ee33878f7 (diff)
parentaba291e2de1682620b6dc22446b30fe870b62956 (diff)
Merge commit 'aba291e2de1682620b6dc22446b30fe870b62956' as 'puppet/modules/apt'
Diffstat (limited to 'puppet/modules/apt/lib/facter/debian_nextrelease.rb')
-rw-r--r--puppet/modules/apt/lib/facter/debian_nextrelease.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/puppet/modules/apt/lib/facter/debian_nextrelease.rb b/puppet/modules/apt/lib/facter/debian_nextrelease.rb
new file mode 100644
index 00000000..2a9c4f5f
--- /dev/null
+++ b/puppet/modules/apt/lib/facter/debian_nextrelease.rb
@@ -0,0 +1,23 @@
+def debian_release_to_next(release)
+ releases = [
+ 'oldoldoldstable',
+ 'oldoldstable',
+ 'oldstable',
+ 'stable',
+ 'testing',
+ 'unstable',
+ 'experimental',
+ ]
+ if releases.include? release
+ if releases.index(release)+1 < releases.count
+ return releases[releases.index(release)+1]
+ end
+ end
+end
+
+Facter.add(:debian_nextrelease) do
+ confine :operatingsystem => 'Debian'
+ setcode do
+ debian_release_to_next(Facter.value('debian_release'))
+ end
+end