summaryrefslogtreecommitdiff
path: root/puppet/modules/apt/lib/facter/debian_nextrelease.rb
blob: 2a9c4f5f1cb7da7877c17038a8f6a30bed8a4c49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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