How to export resource with dynamic content from agent?
I'm deploying a riak node (a no-sql database) with puppet. I also need to deploy application nodes where the applications need to be configured with credentials for accessing the riak database.
Creating the riak system includes creating accounts in the riak system (using the exec type). The response from this account creation includes the public/private key pair for the account. These riak account key pairs are to be used in the applications on other nodes, which need to access the riak database.
I would like to use Exported Resources to store these keys in puppetdb and retrieve them later on other nodes when required.
The problem with this is that I don't know these keys when the catalog for the riak node is compiled on the puppet master. The keys are created dynamically by the riak system when the agent applies the catalog on the riak node, and by then it's too late for any variable interpolation in my exported resource definition.
How can I pick up data that is generated during the puppet agent run on the riak node so that it can be sent back to puppetdb as an exported resource?
Or should I forget about exported resources and do it in a completely different way?