[Pkg-puppet-devel] [facter] 139/180: Add LinuxMint to operating system facts
Stig Sandbeck Mathisen
ssm at debian.org
Mon Jun 30 15:06:40 UTC 2014
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository facter.
commit 204ee177f7cdaf863d0f4fdaf46a9979a9aa72d5
Author: Carl-Christian Salvesen <calle at ioslo.net>
Date: Wed Jun 5 13:32:04 2013 +0200
Add LinuxMint to operating system facts
This commit was cherry-picked from 1938f39.
Conflicts:
lib/facter/operatingsystemrelease.rb
lib/facter/osfamily.rb
---
lib/facter/operatingsystem.rb | 2 ++
lib/facter/operatingsystemrelease.rb | 13 +++++++++++++
lib/facter/osfamily.rb | 2 +-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/lib/facter/operatingsystem.rb b/lib/facter/operatingsystem.rb
index 74fbe1f..b484f46 100644
--- a/lib/facter/operatingsystem.rb
+++ b/lib/facter/operatingsystem.rb
@@ -52,6 +52,8 @@ Facter.add(:operatingsystem) do
setcode do
if Facter.value(:lsbdistid) == "Ubuntu"
"Ubuntu"
+ elsif Facter.value(:lsbdistid) == "LinuxMint"
+ "LinuxMint"
elsif FileTest.exists?("/etc/debian_version")
"Debian"
elsif FileTest.exists?("/etc/openwrt_release")
diff --git a/lib/facter/operatingsystemrelease.rb b/lib/facter/operatingsystemrelease.rb
index f980963..5927c44 100644
--- a/lib/facter/operatingsystemrelease.rb
+++ b/lib/facter/operatingsystemrelease.rb
@@ -73,12 +73,25 @@ Facter.add(:operatingsystemrelease) do
end
Facter.add(:operatingsystemrelease) do
+ confine :operatingsystem => 'LinuxMint'
+ setcode do
+ if release = Facter::Util::FileRead.read('/etc/linuxmint/info')
+ if match = release.match(/RELEASE\=(\d+)/)
+ match[1]
+ end
+ end
+ end
+end
+
+Facter.add(:operatingsystemrelease) do
confine :operatingsystem => 'CumulusLinux'
setcode do
Facter::Util::Operatingsystem.os_release['VERSION_ID']
end
end
+
+
Facter.add(:operatingsystemrelease) do
confine :operatingsystem => %w{SLES SLED OpenSuSE}
setcode do
diff --git a/lib/facter/osfamily.rb b/lib/facter/osfamily.rb
index fcd9d4d..f39633d 100644
--- a/lib/facter/osfamily.rb
+++ b/lib/facter/osfamily.rb
@@ -18,7 +18,7 @@ Facter.add(:osfamily) do
case Facter.value(:operatingsystem)
when "RedHat", "Fedora", "CentOS", "Scientific", "SLC", "Ascendos", "CloudLinux", "PSBM", "OracleLinux", "OVS", "OEL", "Amazon", "XenServer"
"RedHat"
- when "Ubuntu", "Debian", "CumulusLinux"
+ when "LinuxMint", "Ubuntu", "Debian", "CumulusLinux"
"Debian"
when "SLES", "SLED", "OpenSuSE", "SuSE"
"Suse"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git
More information about the Pkg-puppet-devel
mailing list