Skip to content

Commit

Permalink
Merge pull request #129 from jcpunk/syspurpose-facts
Browse files Browse the repository at this point in the history
Add syspurpose entries to facts
  • Loading branch information
jcpunk authored Jul 9, 2024
2 parents 95a0531 + a62d6cf commit 45166a6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/facter/rhsm.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'puppet/util/inifile'
require 'puppet/util/json'

Facter.add(:rhsm, type: :aggregate) do
confine :os do |os|
Expand Down Expand Up @@ -40,6 +41,12 @@
end
end

# Find any syspurpose defined
chunk(:syspurpose) do
syspurpose = Puppet::Util::Json.load_file_if_valid('/etc/rhsm/syspurpose/syspurpose.json') if File.exist? '/etc/rhsm/syspurpose/syspurpose.json'
syspurpose unless syspurpose.empty?
end

# Add satellite server information
if File.exist? '/etc/rhsm/rhsm.conf'
chunk(:server) do
Expand Down

0 comments on commit 45166a6

Please sign in to comment.