GithubHelp home page GithubHelp logo

Comments (10)

ekohl avatar ekohl commented on September 4, 2024

I'm unfamiliar with puppet on windows so we're going to have to see how far we can come here. Can you share which files do exist on .../var/lib/facter?

from puppet-foreman.

lazyfrosch avatar lazyfrosch commented on September 4, 2024

That is the fact "facts" inside this module: foreman/lib/facter/facts.rb

I guess sssd Ruby stuff is not available on a Windows.

Though the fact should not fail, but silently doing nothing. We need to catch that second require there...

from puppet-foreman.

lazyfrosch avatar lazyfrosch commented on September 4, 2024

Also it might be not a good idea to name this file "facts.rb", that is a single namespace...

from puppet-foreman.

genebean avatar genebean commented on September 4, 2024

So... here is what I have on a Windows host:

PS D:\> cd c:\ProgramData\PuppetLabs\puppet\var\lib\facter
PS C:\ProgramData\PuppetLabs\puppet\var\lib\facter> dir

    Directory: C:\ProgramData\PuppetLabs\puppet\var\lib\facter

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----          2/2/2015   8:49 PM            util
-a---          2/2/2015   8:49 PM        920 apt_updates.rb
-a---          2/2/2015   8:49 PM        597 apt_update_last_success.rb
-a---          2/2/2015   8:49 PM        212 concat_basedir.rb
-a---          2/2/2015   8:49 PM       1127 eselect.rb
-a---          2/2/2015   8:49 PM       4667 facter_dot_d.rb
-a---          2/2/2015   8:49 PM       1072 facts.rb
-a---          2/2/2015   8:49 PM        218 gemhome.rb
-a---          2/2/2015   8:49 PM        236 ip6tables_version.rb
-a---          2/2/2015   8:49 PM        444 iptables_persistent_version.rb
-a---          2/2/2015   8:49 PM        234 iptables_version.rb
-a---          2/2/2015   8:49 PM       2520 oracle_database_homes.rb
-a---          2/2/2015   8:49 PM       1172 pe_version.rb
-a---          2/2/2015   8:49 PM        210 portage.rb
-a---          2/2/2015   8:49 PM        937 puppet_vardir.rb
-a---          2/2/2015   8:49 PM        104 r10k_environment.rb
-a---          2/2/2015   8:49 PM        875 root_home.rb
-a---          2/2/2015   8:49 PM        618 staging_http_get.rb
-a---          2/2/2015   8:49 PM        251 staging_windir.rb
-a---          2/2/2015   8:49 PM        232 sudoversion.rb

And here is the util directory:

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---          2/2/2015   8:49 PM        432 portage.rb
-a---          2/2/2015   8:49 PM        660 puppet_settings.rb
-a---          2/2/2015   8:49 PM        481 sssd.rb

If I look in facts.rb (which, I agree, could do with renaming) I see all the sssd stuff. Originally, I mistakenly thought this was a Puppet bug so I opened FACT-798 and in there it was suggested that a confine based on kernel was needed in the fact.

from puppet-foreman.

ekohl avatar ekohl commented on September 4, 2024

My guess is that there's no augeas on windows and that it fails because of it.

from puppet-foreman.

logicminds avatar logicminds commented on September 4, 2024

Is plugin sync enabled? the facts.rb is a foreman custom fact. It it looks like its not loading into your lib ruby path correctly.

from puppet-foreman.

genebean avatar genebean commented on September 4, 2024

Yep, its on.

from puppet-foreman.

lazyfrosch avatar lazyfrosch commented on September 4, 2024

Yeah that might actually be the problem that augeas inside sssd.rb can not be loaded:

# facts.rb
begin
  require 'facter/util/sssd' # NOTE: augeas failed to load inside
rescue LoadError
  # Puppet 2 compatibility, facter/ dir is the load path, not lib/
  require 'util/sssd' # NOTE: fails because it's NOT Puppet 2
end

Any good idea how to skip that fact if augeas is not available?

from puppet-foreman.

domcleal avatar domcleal commented on September 4, 2024

In util/sssd.rb we could do:

begin
  require 'augeas'
  module Facter::Util::Sssd
     # ...
  end
rescue LoadError => e
  Facter.debug("Cannot load Augeas library for custom facts: #{e}")
end

And in facts.rb (that really needs renaming to not be generic):

if defined? Facter::Util::Sssd
  Facter.add .....
  Facter.add .....
end

from puppet-foreman.

ekohl avatar ekohl commented on September 4, 2024

I think the solution @domcleal wrote sounds good. Anyone willing and able to come up with patches?

from puppet-foreman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.