Issue #3741 has been updated by Gary Larizza.
I tried this out with a PE 2.0 install and three custom facts. Here's my info:
modulepath => /etc/puppetlabs/puppet/modules
custom facts =>
/etc/puppetlabs/puppet/modules/custom_facts/lib/facter/{gem_count.rb,listen_ports.rb,yum_package.rb}
vardir => /var/opt/lib/pe-puppet
I tried to replicate Mikael's results from the previous update, so I moved all
my facts from $modulepath/custom_facts/lib/facter to
$modulepath/custom_facts/lib/facter/facts and ran a puppet agent -t with the
following results:
<pre>
[root@puppetmaster facter]# puppet agent -t
info: Retrieving plugin
notice: /File[/var/opt/lib/pe-puppet/lib/facter/facts]/ensure: created
notice: /File[/var/opt/lib/pe-puppet/lib/facter/facts/yum_package.rb]/ensure:
defined content as '{md5}9a3997748b884eda98768e1d8efa03b4'
notice: /File[/var/opt/lib/pe-puppet/lib/facter/facts/listen_ports.rb]/ensure:
defined content as '{md5}5a1ab955bf42f46de808a3fa60429613'
notice: /File[/var/opt/lib/pe-puppet/lib/facter/facts/gem_count.rb]/ensure:
defined content as '{md5}fc69c510e630b0ab52867f58150cf3e0'
info: Loading downloaded plugin
/var/opt/lib/pe-puppet/lib/facter/facts/gem_count.rb
info: Loading downloaded plugin
/var/opt/lib/pe-puppet/lib/facter/facts/listen_ports.rb
info: Loading downloaded plugin
/var/opt/lib/pe-puppet/lib/facter/facts/yum_package.rb
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Caching catalog for puppetmaster.puppetlabs.vm
info: Applying configuration version '1323894187'
</pre>
That's all well and good, but let's run puppet agent -t again:
<pre>
[root@puppetmaster facter]# puppet agent -t
info: Retrieving plugin
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Caching catalog for puppetmaster.puppetlabs.vm
info: Applying configuration version '1323894219'
notice: /Stage[main]/Pe_mcollective/Service[pe-activemq]/ensure: ensure changed
'stopped' to 'running'
notice: Finished catalog run in 1.90 seconds
</pre>
It doesn't load my custom facts. Checking the $vardir/lib/facter, they're
still there:
<pre>
[root@puppetmaster facter]# ls -la /var/opt/lib/pe-puppet/lib/facter/facts/
total 20
drwxr-xr-x 2 root root 4096 Dec 14 20:23 .
drwxr-xr-x 3 root root 4096 Dec 14 20:23 ..
-rw-r--r-- 1 root root 97 Dec 14 20:23 gem_count.rb
-rw-r--r-- 1 root root 573 Dec 14 20:23 listen_ports.rb
-rw-r--r-- 1 root root 255 Dec 14 20:23 yum_package.rb
</pre>
Removing them from the vardir will force a sync from the master:
<pre>
[root@puppetmaster facter]# rm -Rf /var/opt/lib/pe-puppet/lib/facter/facts/
[root@puppetmaster facter]# puppet agent -t
info: Retrieving plugin
notice: /File[/var/opt/lib/pe-puppet/lib/facter/facts]/ensure: created
notice: /File[/var/opt/lib/pe-puppet/lib/facter/facts/yum_package.rb]/ensure:
defined content as '{md5}9a3997748b884eda98768e1d8efa03b4'
notice: /File[/var/opt/lib/pe-puppet/lib/facter/facts/listen_ports.rb]/ensure:
defined content as '{md5}5a1ab955bf42f46de808a3fa60429613'
notice: /File[/var/opt/lib/pe-puppet/lib/facter/facts/gem_count.rb]/ensure:
defined content as '{md5}fc69c510e630b0ab52867f58150cf3e0'
info: Loading downloaded plugin
/var/opt/lib/pe-puppet/lib/facter/facts/gem_count.rb
info: Loading downloaded plugin
/var/opt/lib/pe-puppet/lib/facter/facts/listen_ports.rb
info: Loading downloaded plugin
/var/opt/lib/pe-puppet/lib/facter/facts/yum_package.rb
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Loading facts in facter_dot_d
info: Caching catalog for puppetmaster.puppetlabs.vm
info: Applying configuration version '1323894317'
</pre>
So, while it appears pluginsync will SYNC the subdirectory if it doesn't exist
(and LOAD the facts during that sync), it doesn't appear as if Puppet/Facter
will LOAD the facts during a Puppet run (though the facts are still in the
$vardir)
----------------------------------------
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.