Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-2588

ipa_facts : does not extract info from sssd.conf

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Template:
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      This problem is related to: https://projects.theforeman.org/issues/29649

      When I run `facter ipa` on an ipa enabled host I get no output:

      So when looking at the code:

      if File.exist?('/etc/sssd/sssd.conf') && sssd = File.readlines('/etc/sssd/sssd.conf')                                                                                         
        sssd.each do |line|                                                                                                                                                         
          case line                                                                                                                                                                 
            when /^ipa_domain/                                                                                                                                                      
              Facter.add("ipa_domain") do                                                                                                                                           
                    has_weight 100                                                                                                                                                  
                setcode do                                                                                                                                                          
                  line.split("=")[1].strip                                                                                                                                          
                end                                                                                                                                                                 
              end                                                                                                                                                                   
            when /^ipa_server/                                                                                                                                                      
              Facter.add("ipa_server") do                                                                                                                                           
                    has_weight 100                                                                                                                                                  
                setcode do                                                                                                                                                          
                  line.split("=")[1].strip                                                                                                                                          
                end                                                                                                                                                                 
              end                                                                                                                                                                   
            when /^auth_provider/                                                                                                                                                   
              Facter.add("ipa_enrolled") do                                                                                                                                         
      
      

      This code looks OK, but it doesn't find what it's looking for:

       

      root@theforeman ~ # ag '(ipa_domain|ipa_server|auth_provider)' /etc/sssd/sssd.conf |sed -e 's|mycompany.com|example.com|g'
      auth_provider = ipa
      ipa_domain = example.com
      ipa_server = _srv_, gandalf.example.com, olorin.example.com, mithrandir.example.com
      ipa_server_mode = false
      

      IMHO the regexes should have a space added, ipa_server_mode should not have been matched. But that is beside the point. What's going wrong here?

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            hboetes Han Boetes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support