0

Puppet Master has 3.6.2 version installed in RHEL 6.6.

I have created a fact on agent server(Puppet 3.8.4) inside /var/lib/puppet/lib/facter/last_run.rb. The content of the file was simply to echo system date:

require 'facter'

Facter.add("last_run") do
  setcode do
    Facter::Util::Resolution.exec('date')
  end
end

sudo facter -p last_run when triggered in master server returns the sysdate

My question is: if i do puppet agent -t in client server it does not load facts though

kanchan
  • 1
  • 4
  • You have several problems here, but the first is that you are writing a fact in a Puppet manifest. Check the documentation here to start: https://docs.puppet.com/facter/3.6/custom_facts.html. – Matthew Schuchard Jul 05 '17 at 11:43
  • The other big problem is the Puppet Master and Puppet Agent should be the same version of Puppet. Without testing, however, I would not know why the demo.pp file is deleted. – Alex Harvey Jul 05 '17 at 11:47
  • yes..puppet master and puppet agent should be of same version..but i did not get any error on connecting with puppet master using(puppet agent -t)..It infacts generate certificate..how to understand that the verison should be same? – kanchan Jul 05 '17 at 12:38
  • hello,still not able to fix this issue though in puppet server i can see facts are deplyed to agent since a a file is updated in (/var/lib/puppet/yaml/facts) everytime i run [puppet agent -t] in agent server – kanchan Jul 10 '17 at 07:43
  • but still there is no ruby files created inside /var/lib/puppet/var/lib in agents erver – kanchan Jul 10 '17 at 07:43
  • resolved....after placing ruby files in /etc/puppet/modules/mobistar/lib/facter/last_rub.rb – kanchan Jul 18 '17 at 10:48

0 Answers0