diff options
Diffstat (limited to 'puppet/modules/apt/lib/facter/ubuntu_nextcodename.rb')
m--------- | puppet/modules/apt | 0 | ||||
-rw-r--r-- | puppet/modules/apt/lib/facter/ubuntu_nextcodename.rb | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/puppet/modules/apt b/puppet/modules/apt deleted file mode 160000 -Subproject 33c61e8df59db1abbed379a9e9790946060a8f1 diff --git a/puppet/modules/apt/lib/facter/ubuntu_nextcodename.rb b/puppet/modules/apt/lib/facter/ubuntu_nextcodename.rb new file mode 100644 index 00000000..dcd1d426 --- /dev/null +++ b/puppet/modules/apt/lib/facter/ubuntu_nextcodename.rb @@ -0,0 +1,20 @@ +begin + require 'facter/util/ubuntu' +rescue LoadError + require "#{File.dirname(__FILE__)}/util/ubuntu" +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 |