Hi, can anyone using facts verify that what I'm doing should be correct ?
On Oct 13, 2009, at 8:13 PM, desdic wrote: > > Hi, > > I have been trying to make facts work via modules (According to > http://reductivelabs.com/trac/puppet/wiki/PluginsInModules) but its > simply not working. I have been getting help via #puppet (And that has > been a big help) but still no luck > > Data: > > Master+server running Debian with puppet version 0.24.5-3 > > puppetteer:/etc/puppet/modules/mysqlserver# find . > . > ./manifests > ./manifests/init.pp > ./plugins > ./plugins/facter > ./plugins/facter/mysqlversion.rb > ./files > > puppetteer:/etc/puppet/modules/mysqlserver# cat plugins/facter/ > mysqlversion.rb > require 'facter' > > Facter.add("mysqlversion") do > setcode do > %x{mysql -V}.chomp > end > end > > and in my manifest I use > > case $mysqlversion { > default: { > err(" mysqlversion is $mysqlversion") > err(" mysqlserver is $mysqlserver") > } > } > > but the strings $mysqlversion and $mysqlserver is always empty. I run > my puppetmaster with puppetmasterd --no-daemonize -d --verbose and the > client with puppetd --no-daemonize -d -o --verbose > > now when I run this I get the debug message: > > .... > debug: importing '/etc/puppet/modules/mysqlserver/manifests/init.pp' > info: Autoloaded module mysqlserver > err: Scope(Class[mysqlserver]): mysqlversion is > err: Scope(Class[mysqlserver]): mysqlserver is > ... > > but if I add this on the client > > # mkdir -p ~/lib/ruby/facter ; export RUBYLIB=~/lib/ruby > # cd ~/lib/ruby/facter > > and then add the same .rb script but with Facter.add("mysqlserver") > and then run the master + client again I actually get the mysqlversion > filled in $mysqlserver .. so my facter is working but to me it seems > that its not beein distributed to the client or a path is missing > > my server configuration: > [main] > logdir=/var/log/puppet > vardir=/var/lib/puppet > ssldir=/var/lib/puppet/ssl > rundir=/var/run/puppet > factpath=$vardir/lib/facter > pluginsync=true > > [puppetmasterd] > templatedir=/var/lib/puppet/templates > > my client configuration: > [main] > logdir=/var/log/puppet > vardir=/var/lib/puppet > ssldir=/var/lib/puppet/ssl > rundir=/var/run/puppet > factpath=$vardir/lib/facter > pluginsync=true > server=puppetteer.netgroup.dk > factsignore=.svn CVS *.*~ > > [puppetmasterd] > templatedir=/var/lib/puppet/templates > > anyone can tell me I'm doing wrong ? > > Best regards > Kim > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---