1 # Fact: is_pe, pe_version, pe_major_version, pe_minor_version, pe_patch_version
3 # Purpose: Return various facts about the PE state of the system
5 # Resolution: Uses a regex match against puppetversion to determine whether the
6 # machine has Puppet Enterprise installed, and what version (overall, major,
7 # minor, patch) is installed.
11 Facter.add("pe_version") do
13 pe_ver = Facter.value("puppetversion").match(/Puppet Enterprise (\d+\.\d+\.\d+)/)
18 Facter.add("is_pe") do
20 if Facter.value(:pe_version).to_s.empty? then
28 Facter.add("pe_major_version") do
29 confine :is_pe => true
31 if pe_version = Facter.value(:pe_version)
32 pe_version.to_s.split('.')[0]
37 Facter.add("pe_minor_version") do
38 confine :is_pe => true
40 if pe_version = Facter.value(:pe_version)
41 pe_version.to_s.split('.')[1]
46 Facter.add("pe_patch_version") do
47 confine :is_pe => true
49 if pe_version = Facter.value(:pe_version)
50 pe_version.to_s.split('.')[2]