puppet cert list output to feed a client content file
I am trying to create a file on a particular server managed by puppet. This file will have as content all the systems currently managed by puppet (fqdn) I have more or less an idea of how to do it, but i would like get your opinion.
In a glance, what I am trying to do is: 1. run puppet cert list -all | grep "webserver" on the puppet master note: naming convention for my webservers is: webserver01, webserver02.... 2. pick up the fqdn associated with each of them and point the output to a file (erb template for example) 3. use that template to generate the content on a particular file to be deployed to a particular server.
The idea is to always have that file up to date, no matter whether systems have been added or removed from puppet master.
Therefore, my question is: would you be using a cron job in the puppet master to generate that content? would you prefer to apply a manifest on the puppet master to perform that command and generate that content each puppet run? any other ideas?
Many thanks in advance.