puppet custom fact

We will ad custom puppet fact that will show ruby path.

create file

/etc/puppet/modules/YOU_MODULE_NAME/lib/facter/rubypath.rb

add following ruby code


Facter.add(:rubypath) do
setcode 'which ruby'
end

run on puppet gent

facter --puppet rubypath

Custom facts from modules are only used on puppet runs.

Tags

puppet custom fact