-
Notifications
You must be signed in to change notification settings - Fork 51
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
Some valid Ruby Puppetfiles are not interpreted #63
Comments
Oh, I've never seen that Puppetfile format to be honest. I'm always looking at https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd I don't know if I'm going to support that format. I'd rather just use a YAML file or something similar. |
That's OK. This is very cool:
👍 |
Puppetfile, by the way, is a Ruby DSL. |
Yeah, which makes it difficult for any other language than Ruby to parse a Puppetfile. Trust me I know 😀 Same problem as #36 |
Maybe you can take a ruby syntax parser, for example from grubby and get the real meaning out of it that way. On the other hand, you would then have a ruby syntax parser and people would be able to write loops and stuff, which would open a whole new level of mess :D |
@alexharv074 11 seconds is too much for 39 modules (but perhaps you have a high latency to your git server, or you disabled hardlinks). |
@xorpaul In ntnn/puppetfiler I've written some code which parses a puppetfile to yaml. One possibility to resolve issues like these could be to extract that functionality to its own gem and to use that in g10k, e.g. by distributing it in the same tarball. Enabling you to remove the regexes parsing g10k with all their blind spots. What do you think of that? |
I appreciate the suggestion, but bundling a ruby gem with g10k isn't really something that I want to do. I'm testing a YAML based Puppetfile at the moment, which should resolve such issues. |
Not really sure how a YAML config file helps people who want to use this tool in the way that it is advertised, i.e. as a drop-in replacement for r10k. If the tool fails to read a Puppetfile, then it might be a useful alternative to r10k; but it is not a drop-in replacement. I for one would not be able to use it at all if it can't support real Puppetfiles because my code needs to be compatible with a real r10k. |
@alexharv074 The r10k Puppetfile format parsing will remain in g10k. I'm just testing if I can provide advanced features like variable interpolation more easily inside a YAML based Puppetfile. |
As some already mentioned the issue is that the Puppetfile supports ruby syntax and people are doing all kinds of wild things with it. A very nice solution would be to simply provide a hook for executing a script between when the control repository is checked out and g10k deploys the modules. This way we can transform whatever logic was in that old Puppetfile and just generate one with it g10k understands. |
Just wanted to leave my 2 cents here that I also stumbled upon this by wondering what was wrong with my file when |
When executing
g10k -puppetfile
I get:My Puppetfile has modules declared as:
Workaround for me was to rewrite the Puppetfiles using a regexp:
The text was updated successfully, but these errors were encountered: