summaryrefslogtreecommitdiffstats
path: root/lib/facter/puppetversion.rb
blob: 01422f03d13c6f857b7cc50628f6ff38f578789d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Fact: puppetversion
#
# Purpose: Return the version of puppet installed.
#
# Resolution:
#   Requres puppet via Ruby and returns it's version constant.
#
# Caveats:
#

Facter.add(:puppetversion) do
    setcode do
        begin
            require 'puppet'
            Puppet::PUPPETVERSION.to_s
        rescue LoadError
            nil
        end
    end
end