ShadowFacter allows the simple definition and gathering of facts
using Facter[http://reductivelabs.com/projects/facter/].
Sample facts:
$ cat examples/lib/facts/kernel.rb
require 'shadow_facter'
namespace :kernel do
fact :name do
exec "uname -s"
end
fact :release do
exec "uname -r"
end
fact :version do
facts(:kernel)[:release].to_s.split('.')[0]
end
end
Executing this fact:
$ bin/shadow_facter examples/lib/facts/kernel.rb
kernel_name => Darwin
kernel_version => 9
kernel_release => 9.6.0
$
The shadow_facter binary parses the given ruby code, which is
expected to contain a definition of a namespace and some facts. Facts are
gathered and outputed.
Required files
optparse
rubygems
shadow_facter