Ask Your Question

Can Puppet report on installed software by machine. Ideally would be completed using an API hook into a third party application.

asked 2019-01-16 15:18:58 -0600

MDL gravatar image

Can Puppet provide a report of all installed software by machine? Looking to obtain this information from Linux machines and import that data into an ITSM tool using an API script.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-01-17 11:16:49 -0600

LeroyT gravatar image

updated 2019-01-17 11:20:51 -0600

I don't know if this is available in "core" Puppet (you didn't specify Enterprise or Open Source) but there is a feature known as "external facts" ( which you can use to collect just about anything your creativity can produce. There are some things to be aware of. As best as I can tell, facts are evaluated at the start of a Puppet run so you can't define an external fact and use it in the same run (but it will be available in subsequent runs). As a result, if you're using the default of a run every 30 minutes, an external fact will be available in an hour. To keep from getting errors in your manifest(s), use a conditional test for something you are sure will appear in the fact once it's available.

You mentioned Linux systems, Windows presents its own challenges. First, there is more than one location (C:\Documents and Settings\All Users\Application Data\PuppetLabs\facter\facts.d, C:\ProgramData\PuppetLabs\facter\facts.d or C:\Users\All Users\PuppetLabs\facter\facts.d) where external facts are located depending on Windows version and I'm not aware of a way that Puppet reports that location. A solution to this is to use execs in your manifest with an "if exist ..." for the directory (three execs). If the directory is found put a batch file there containing "echo puppetroot=<that directory>" (use any name you want in place of puppetroot). Use a conditional test for that variable containing C: in your manifest and, if found, use that path to add whatever additional external facts you need there. The second challenge is whether Windows has a command-line utility to report installed programs or not (and, if the program was installed without using Windows features - you're on your own), I don't have an answer to this one.

I'm using open source Puppet so the location will likely vary if you're using Enterprise but, for open source, /var/lib/puppet/yaml/facts (or node) contains a file for each system and that file will contain all facts (internal or external once defined) for the system (do check the file date to insure it's current). You can write a script to process all files in that directory to obtain your inventories.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-01-16 15:18:58 -0600

Seen: 71 times

Last updated: Jan 17