2015-05-11 16:49:27 +02:00
|
|
|
begin
|
|
|
|
require 'facter/util/ubuntu'
|
2015-12-07 14:27:04 +01:00
|
|
|
rescue LoadError
|
2015-12-07 21:55:01 +01:00
|
|
|
require "#{File.dirname(__FILE__)}/util/ubuntu"
|
2015-05-11 16:49:27 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def ubuntu_codename_to_next(codename)
|
|
|
|
codenames = Facter::Util::Ubuntu::CODENAMES
|
|
|
|
i = codenames.index(codename)
|
|
|
|
if i and i+1 < codenames.count
|
|
|
|
return codenames[i+1]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Facter.add(:ubuntu_nextcodename) do
|
|
|
|
confine :operatingsystem => 'Ubuntu'
|
|
|
|
setcode do
|
|
|
|
ubuntu_codename_to_next(Facter.value('ubuntu_codename'))
|
|
|
|
end
|
|
|
|
end
|