A collection of task oriented solutions in Puppet

 

Display fact resolution timings

Challenge

Facter takes a long time to run and you want to know which fact is the culprit.

Solution

# present in facter 1.5.9+
$ facter -t
...
facterversion: 0.04ms
arp: 25.87ms
puppetversion: 401.19ms
sshrsakey: 0.17ms
netmask_lo: 7.05ms
...

Explanation

There are times, mostly when you are writing your own facts, that something causes facter or puppet to take a lot longer than you would normally expect. Running facter with the -t option will trace each facts resolution and print how long it takes. This will often be enough to pinpoint the misbehaving fact and for the real work to begin.