| « CentOS and reissue of updated packages for CVE-2008-1447 | time warp! » |
puppet fact for CentOS Version
I looked and found nothing for this, so wrote this quick fact for puppet.
# centos_version.rb
Facter.add("centos_version") do
setcode do
%x{/bin/rpm --qf "%{version}\n" -q centos-release}.chomp
end
end
Once its in your facts/ you can do things like this in your puppet manifests :
case $centos_version {
4: { ... }
5: { ... }
default: { .... }
}
- KB
1 comment
Comment from: jtimberman [Visitor]
You might take a look at the latest version of Facter, 1.5. It has better version detection on Red Hat and CentOS. Look for the operatingsystemrelease fact.
12/Jul/2008 @ 17:40