Hi,
I've created this fact:
require 'facter'
if FileTest.exists?("/etc/ha.d")
if `service heartbeat status` =~ /running/
cib = `cibadmin -Q`.grep(/epoch/).to_s
epoch = cib.scan(/[0-9]+/).first
Facter.add("cib_epoch") do
setcode do
epoch.to_i + 1
end
end
end
end
end
I've tested it as directed in the wiki:
# facter cib_epoch
1
I've put it in /etc/puppet/facts, and run puppet on a cluster node.
I get:
# puppetd --test --debug
info: Loading fact cib_epoch
/usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:420:in
`load': /var/puppet/facts/cib_epoch.rb:17: syntax error (SyntaxError)
from /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:420:in
`loaddir'
from /usr/lib/ruby/1.8/timeout.rb:56:in `timeout'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:419:in
`loaddir'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:415:in
`each'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:415:in
`loaddir'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:431:in
`loadfacts'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:430:in
`each'
from /usr/lib/ruby/site_ruby/1.8/puppet/network/client/master.rb:430:in
`loadfacts'
... 7 levels...
from /usr/lib/ruby/site_ruby/1.8/puppet/util/subclass_loader.rb:36:in
`client'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/subclass_loader.rb:67:in
`send'
from /usr/lib/ruby/site_ruby/1.8/puppet/util/subclass_loader.rb:67:in
`method_missing'
from /usr/sbin/puppetd:322
Any ideas what's wrong?
S.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---