Score:0

Is there a way to retrieve the config_version value as a variable?

mq flag

I use Puppet with r10k and a custom External Node Classifier.

The need is to write the commit hash value into a templated ERB file on each managed node.

I added a script (https://github.com/puppetlabs/control-repo/tree/production/scripts), declared in the environment.conf file that retrieves this hash in the .r10k-deploy.json file. I get the hash value in the puppet logs and on PuppetBoard.

However, I do not know how to retrieve this value in a variable, like $config_version, to use it in a templated file.

Is there a built-in variable that stores this value ?

The other solution I'm considering, which is a bit more complex, is to maintain the hashes of each environment in the database that is used by the ENC, either manually or with a script that retrieves the commit hashes of each environment.

By adapting the ENC I would be able to make this value available to the nodes.

Thanks for your help,

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.