Introduction:
A few month ago I faced an issue which was caused by puppet. I tried to search (and I found) the reason, why puppet generate config-file for non-exist host for bacula (but it could be happened everywhere, like in nagios config; /etc/hosts entry;…). Now I will explain one tool what you can use for see, what is in puppetDB.
Guide:
You can use this method in puppet-master host. The command:
Where “your_query” file contain the following:
Lets explain it:
The curl command will be query your request. The only variable, what you must to edit is “your_query” . Replace it with your file-name where you declared the search-terms.
The example of file-content will be search for host with test-mysql01 certification-name & filter the result just to exported resources.
HINT:
For first usage I recommend to start an empty search to see, which kind of data you have on db. After it is much more easier to filter & use the right resource-name.
Warning: Couldn’t read data from file “query@”, this makes an empty POST.
Of course you can use linux commands like grep to filter your result.
For more possibility, please visit Puppet’s official site .