2015-05-11 16:49:27 +02:00
|
|
|
begin
|
|
|
|
require 'facter/util/debian'
|
2015-12-07 14:27:04 +01:00
|
|
|
rescue LoadError
|
|
|
|
require "#{File.dirname(__FILE__)}/util/debian"
|
2015-05-11 16:49:27 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def debian_codename_to_next(codename)
|
|
|
|
if codename == "sid"
|
|
|
|
return "experimental"
|
|
|
|
else
|
2015-12-07 16:51:20 +01:00
|
|
|
codenames = Facter::Util::Debian::CODENAMES
|
|
|
|
versions = Facter::Util::Debian::CODENAMES.invert
|
|
|
|
current_version = versions[codename]
|
|
|
|
return codenames[(current_version.to_i + 1).to_s]
|
2015-05-11 16:49:27 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Facter.add(:debian_nextcodename) do
|
|
|
|
confine :operatingsystem => 'Debian'
|
|
|
|
setcode do
|
|
|
|
debian_codename_to_next(Facter.value('debian_codename'))
|
|
|
|
end
|
|
|
|
end
|