I'm using R10K with Puppet. The Puppetfile
is basically DSL:
Because the Puppetfile format is actually implemented using a Ruby DSL any valid Ruby expression can be used.
Ref: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd
So based on that, I can write some Ruby code in the Puppetfile
. I tried and it does work. But what I don't find and know, is how to access some variables.
Ultimately, I'm trying to do something like this:
mod 'app',
:git => 'https://github.com/apps/app.git',
:branch => ${environment}
Such that the module branch that is checked out is the same as the environment for which it is checked out. Obviouslt ${environment}
isn't the right syntax and isn't a real variable name.
So the best answer to this question would be how to get a variable of the environment and the second best answer would be how to reference a variable (and what variables are available) in the Puppetfile
.