Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variable interpolation in Puppetfile not working #36

Open
maxadamo opened this issue Feb 18, 2017 · 4 comments
Open

variable interpolation in Puppetfile not working #36

maxadamo opened this issue Feb 18, 2017 · 4 comments

Comments

@maxadamo
Copy link

maxadamo commented Feb 18, 2017

Hi.
I am using variables in my Puppetfile which work with r10k, but they don't seem to work with g10k.

Example from my Puppetfile:

PUPPETENVIRONMENT='test'
DEPOT="ssh://gitlab@git.company.net/puppet"

mod 'company_firewall',
  :git => "#{DEPOT}/company_firewall",
  :ref => "#{PUPPETENVIRONMENT}"

by doing taht, my puppetfile was almost the same across branches. Only this line was changing:
PUPPETENVIRONMENT='test'

@xorpaul
Copy link
Owner

xorpaul commented Feb 19, 2017 via email

@maxadamo
Copy link
Author

probably not a hig priority request... I have created a small wrapper, that create the puppetfile, from a erb template.... I should probably switch to yaml at some point.

@ntnn
Copy link
Contributor

ntnn commented Mar 13, 2017

@xorpaul, r10k can do that because it evaluates the puppetfile as ruby code. I'm doing the same thing in puppetfiler.

I'd propose to execute the Puppetfile, if it is executable or Puppetfile.$extension, and acting on the output with g10k. Imho that would solve the problem elegantly and still be backwards compatible.

@maxadamo
Copy link
Author

@ntnn it's what I have done here by creating a Puppetfile.j2: g10k-webhook
In that case Puppetfile is in .gitignore and it's generated on the fly.
And jinja was easier to use with python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants