hello, I am trying to add a custum fact to my puppet module. I wrote and tested the facter script and it functions as I want it to. I am following the instructions to synchronise the facts/plugins as written in Adding_Facts and plugins_in_modules from the documentation, as in: put factscript in /etc/puppet/modules/<module>/lib/facter add these lines to puppet.conf: [main] pluginsync = true factpath = $vardir/lib/facter when I do a puppetd run on my client, where I want to use the module with my homemade fact, I see the sync taking place, but that is all I see happening. The facts i want to use in the module stay empty, undefined actually. sidenote: if in my current directory there exists a directory facter, where my factscript has been added, then, when starting puppetd -t from there, the facts are added, which would mean, that the factscript works. It just seems, that Puppet doesn''t use the directory to where the script has been synced, despite the entry in puppet.conf Right now i am at a loss, since i cannot see what I''m doing wrong Does anyone have any experience with this? thanx in advance. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Matthew Macdonald-Wallace
2010-Nov-16 17:06 UTC
Re: [Puppet Users] Using custom facts in Puppet
On Tue, 2010-11-16 at 07:33 -0800, JWBoerma wrote:> Right now i am at a loss, since i cannot see what I''m doing wrong > Does anyone have any experience with this? > > thanx in advance. >Can you send the output from the following command: puppetd --test --verbose --no-daemonize And also the source code of your custom fact? Thanks, Matt -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 11/16/2010 09:33 AM, JWBoerma wrote:> hello, > > I am trying to add a custum fact to my puppet module. > I wrote and tested the facter script and it functions as I want it to. >I''ve got the same issue, trying to distribute a custom fact. I''d like to return the version of Plesk Panel running on the client. So I wrote and tested a little fact: # cat plesk_version.rb require ''facter'' Facter.add("plesk_version") do setcode do %x{cat /usr/local/psa/version}.chomp end end root@test10:~/lib/ruby/facter# facter finds this on the client and it returns what I''m looking for. I want to put this on the server and distribute it. My puppet clients and puppetmaster server are 0.25.4. On the puppetmaster I edited /etc/puppet/puppet.conf: [main] logdir=/var/log/puppet vardir=/var/lib/puppet ssldir=/var/lib/puppet/ssl rundir=/var/run/puppet factpath=$vardir/lib/facter pluginpath=$vardir/lib/facter pluginsync=true [puppetmasterd] #templatedir=/var/lib/puppet/templates factsync=true factpath=$vardir/facts and also fileserver.conf: # cat /etc/puppet/fileserver.conf [files] path /var/lib/puppet/files allow * [plugins] path /var/lib/puppet/facts allow * I put my fact file (plesk_version.rb) in the /var/lib/puppet/facts directory. I also put a copy in the /var/lib/puppet/plugins directory. On my client, I ran the puppetd with this command: # /usr/sbin/puppetd --no-daemonize --verbose --onetime --pluginsync I got this: info: Retrieving plugin err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of resource: Could not retrieve information from source(s) puppet://xxx.xxxxx.net/plugins notice: /File[/var/lib/puppet/lib/facter]: Dependency file[/var/lib/puppet/lib] has 1 failures warning: /File[/var/lib/puppet/lib/facter]: Skipping because of failed dependencies This seems to have changed some in 0.25.4, and googleing around has not helped. May I have a pointer to the correct process? Thanks, Ed Greenberg -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Replying to my own post: When run with --test and without --pluginsync, my puppetd returns this: info: Caching catalog for test10.newhostingaccount.net info: Applying configuration version ''1289933909'' notice: Finished catalog run in 1.42 seconds -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Nov 16, 6:06 pm, Matthew Macdonald-Wallace <li...@truthisfreedom.org.uk> wrote:> On Tue, 2010-11-16 at 07:33 -0800, JWBoerma wrote: > > Right now i am at a loss, since i cannot see what I''m doing wrong > > Does anyone have any experience with this? > > > thanx in advance. > > Can you send the output from the following command: > > puppetd --test --verbose --no-daemonize > > And also the source code of your custom fact? > > Thanks, > > MattWhat a good night''s rest can accomplish. I went to gather the information you asked for, when I noticed that somehow an old version was present in my module and was not presenting the right answers. I never checked before, whether it was the right version, hence the problems I was having. After replacing the factscript with the right one, everything worked like a charm. thanx for the response and sorry for the, in hindsight, unnecessary question. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.