[Pkg-puppet-devel] Bug#693203: puppet-common: Custom facts are not correclt executed on Puppet master

Andrea Biancini andrea.biancini at gmail.com
Wed Nov 14 08:59:02 UTC 2012


Package: puppet-common
Version: 2.7.18-2
Severity: minor

Dear Maintainer,
The package for the agent, as provided, does not permit to facts defined on the master to be correctly deployed and used on the agent side.

To reproduce the error, for example, I could define in the master a site.pp as follow:
node puppetclient {
  include modulewithfact

  file { '/tmp/puppettest':
    ensure => present,
    content => $test_fact,
  }
}
And a module, under modules/modulewithfact, that has under the lib/facter a file test_fact.rb as follows:
Facter.add(:test_fact) do
  confine :kernel => "Linux"
  setcode do
        "Content from the fact"
  end
end
Given this configuration the expected behavior should be that the fact is deployed on every agent (of course if they enable pluginsync=true in the puppet.conf) and then properly executed.
So the file /tmp/puppettest should contain the string  "Content from the fact".

This is not happening, with the default configuration, because the agent is not instructed to include in the facterlib path all the facts synchronized from the server.
The problem is that puppet is not sourcing /var/lib/puppet/lib/facter for facts, which is where factsync is writing them.

To avoid this situation I tried a workaround. I simply added to the /etc/default/puppet file the following line:
  FACTERLIB=/var/lib/puppet/lib/facter
which permits to include in the facterlib the folder where facts from the server are synchronized by the agent.
This workaround, however, will not work when calling "puppet agent --test" from the commandline.

I am writing to propose you to add this line in the standard /etc/defatult/puppet file in the puppet package from further versions.
I hope my example and explaination is clear enough.
Regards,
Andrea



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-3-486
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages puppet-common depends on:
ii  adduser            3.113+nmu3
ii  facter             1.6.10-1
ii  libaugeas-ruby1.8  0.4.1-1.1
ii  lsb-base           4.1+Debian7
ii  ruby-shadow        2.1.4-2
ii  ruby1.8            1.8.7.358-4
ii  sysv-rc            2.88dsf-32

Versions of packages puppet-common recommends:
ii  debconf-utils  1.5.46
ii  lsb-release    4.1+Debian7

Versions of packages puppet-common suggests:
pn  librrd-ruby1.8  <none>
pn  ruby-selinux    <none>

-- Configuration Files:
/etc/puppet/puppet.conf changed:
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post
tagmap=$confdir/tagmail.conf
[master]
dns_alt_names=puppet
manifest=$confdir/manifests/site.pp
modulepath=$confdir/modules
reports=store,tagmail


-- no debconf information



More information about the Pkg-puppet-devel mailing list