Issue #3741 has been updated by Mikael Fridh.

Up until now I had the habit of moving all my facter plugins into their own 
directory for categorization or to simply keep things neat, like this:

    modules/mymodule/lib/facter/mymodule/myfact.rb
    modules/mymodule/lib/facter/hardware/bios.rb
    
instead of:
    modules/mymodule/lib/facter/myfact.rb
    modules/mymodule/lib/facter/bios.rb
    
The loading behaviour is different between modulepath loading and the lib path 
loading so moving the facter plugins like I do, actually cause loading to not 
work when you run puppet apply instead of puppet agent with pluginsync. It 
seems modulepath fact plugin loading is non-recursive while lib path loading is 
recursive.

Looks to me to warrant a bug about inconsistent behaviour and recursive loading 
should be done in both cases or what do you think?

recursive loading not working:
    [root@staging-db-lv-3 tmp]# puppet apply --verbose 
--modulepath=/tmp/modules -e 'include stdlib'
    info: Applying configuration version '1326970721'
    notice: root_home is
    notice: /Stage[main]/Stdlib/Notify[something]/message: defined 'message' as 
'root_home is '
    notice: Finished catalog run in 0.03 seconds

moving from subdir facter/stdlib/ to facter/ makes it load:
    [root@staging-db-lv-3 tmp]# mv 
modules/stdlib/lib/facter/stdlib/root_home.rb modules/stdlib/lib/facter/
    [root@staging-db-lv-3 tmp]# puppet apply --verbose 
--modulepath=/tmp/modules -e 'include stdlib'
    info: Loading facts in root_home
    info: Applying configuration version '1326970748'
    notice: root_home is /root
    notice: /Stage[main]/Stdlib/Notify[something]/message: defined 'message' as 
'root_home is /root'
    notice: Finished catalog run in 0.04 seconds
    
----------------------------------------
Bug #3741: Custom facts loaded multiple times
https://projects.puppetlabs.com/issues/3741

Author: Dan Carley
Status: Requires CLA to be signed
Priority: Normal
Assignee: Ash Caire
Category: plug-ins
Target version: Telly
Affected Puppet version: 0.25.4
Keywords: 
Branch: 


As noted by some on puppet-users - 
http://groups.google.com/group/puppet-users/browse_thread/thread/f41cad70f62b9bf7

Puppet clients indicate that they are loading each custom fact more than once.
<pre>
info: Loading facts in layman_conf
info: Loading facts in portage_flags
info: Loading facts in portage_keyword
info: Loading facts in portage_profile
info: Loading facts in raidtype
[..]
info: Loading facts in layman_conf
info: Loading facts in portage_flags
info: Loading facts in portage_keyword
info: Loading facts in portage_profile
info: Loading facts in raidtype
[..]
</pre>

Some relevant settings from @puppet.conf@:
<pre>
vardir = /var/lib/puppet
pluginsync = true
factpath = $vardir/lib/facter
</pre>

Using versions:

* Puppet 0.25.4
* Facter 1.5.2


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to