You have to run facter with the "-p" argument if you want to see facts distributed by Puppet.
-Josh On Mar 9, 2009, at 1:50 PM, Steve Wray wrote: > > Hi there, > > I'm trying to use a fact to tell whether the machine is virtualised. > > I found this and, in testing, its been ok: > http://reductivelabs.com/trac/puppet/wiki/Recipes/VirtualMachine > > However, trying to roll this new fact out has been difficult. > > 1. Debian has got facter looking in /var/puppet/facts while the > package > maintainer has other puppet var stuff in /var/lib/puppet/ I used > puppet to > create a symlink to work around this. > > 2. Following the instructions in > http://reductivelabs.com/trac/puppet/wiki/AddingFacts > I can test this properly from the commandline by setting environment > variables etc so I know that the ruby code is working. > > Ie: > mkdir -p ~/lib/ruby/facter > export RUBYLIB=~/lib/ruby > cp /var/lib/puppet/facts/virtual.rb $RUBYLIB/facter > facter virtual > > does return the expected output. > > > 3. When I run facter from the commandline, without directing > $RUBYLIB to my > home directory, I don't get the expected output. > > When I run facter from strace I can see: > > open("/var/puppet/facts/virtual.rb", O_RDONLY|O_LARGEFILE) = 4 > close(4) = 0 > sigprocmask(SIG_BLOCK, NULL, []) = 0 > open("/var/puppet/facts/virtual.rb", O_RDONLY|O_LARGEFILE) = 4 > close(4) = 0 > open("/var/puppet/facts/virtual.rb", O_RDONLY|O_LARGEFILE) = 4 > fstat64(4, {st_mode=S_IFREG|0755, st_size=1435, ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, > -1, 0) = > 0xb7f67000 > read(4, "Facter.add(\"virtual\") do\n confi"..., 4096) = 1435 > > so I can tell that facter is reading this new fact file. > > But when, from the commandline, I run "facter" or "facter virtual" I > don't > get the expected output. > > > > -- > Please remember that an email is just like a postcard; it is not > confidential nor private nor secure and can be read by many other > people > than the intended recipient. A postcard can be read by anyone at the > mail > sorting office and expecting what is written on it to be private and > secret > is not realistic. Please hold no higher expectation of email. > > If you need to send confidential information in an email you need to > use > encryption. PGP is Pretty good for this. > > > --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---