Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Refreshing Hiera data or other "dynamic" data sources

Hello all,

I've got a question about Hiera or any other possibility to make data dynamic. Currently in our config we use Hiera to have our data and code separated.

So in the manifest we have a piece of code like:

$variable = hiera('some_variable', '')

'some_variable' is now in a YAML file and was put there manually.

Now imagine that normally we keep 'some_variable' in some external data repository (database, LDAP). And I have means (a script) to create a proper YAML file out of this external source. Is there a possibility to include somehow this newly created YAML file in Hiera during a puppet run?

So I'd like to modify the value in the database and forget about everything, and Puppet should execute my script to create a YAML file, and make values from the YAML file available to query in the manifest.

Or maybe I can execute my script to create YAML outside of Puppet, put the file in a git repository and then clone it during the Puppet run?

I'd appreciate hints on how to achieve what I described.