From 946cdbd3c6b116081126027277bfadac4108dbd8 Mon Sep 17 00:00:00 2001 From: Andrew Ward Date: Wed, 3 May 2017 09:25:38 -0700 Subject: [PATCH] If sssd isn't installed or /etc/sssd/sssd.conf doesn't exist set ipa_enrolled to false --- lib/facter/ipa_facts.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/facter/ipa_facts.rb b/lib/facter/ipa_facts.rb index d4b9c53..59861d7 100644 --- a/lib/facter/ipa_facts.rb +++ b/lib/facter/ipa_facts.rb @@ -32,6 +32,15 @@ end end +# If sssd isn't installed, ipa isn't enrolled +if not File.exist?('/etc/sssd/sssd.conf') + Facter.add("ipa_enrolled") do + setcode do + false + end + end +end + # In the event we can't find the records from SSSD, we'll use DNS if Facter.value(:ipa_server).nil? || Facter.value(:ipa_domain).nil? begin