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

Workaround Puppets late binding issue for resources by Being Clever(TM) #39

Closed
wants to merge 1 commit into from
Closed

Workaround Puppets late binding issue for resources by Being Clever(TM) #39

wants to merge 1 commit into from

Conversation

rwilcox
Copy link

@rwilcox rwilcox commented Mar 14, 2012

This pull request works around the late binding issue for Providers by faking out Puppet.

With these modifications I was able to take a virgin virtual machine that has never seen RVM and install RVM, a Ruby, and a gemset for that Ruby.

It works by faking out Puppet - saying that it will run a command (the true command), but then turns around and runs RVM at runtime. Sneaky, and probably something that would get me kicked out of the Puppet Users Guild Of Best Practicing Artisans... but it works! :)

Let me know if you have any questions or if there's anything I can do to make this patch better!
_Ryan Wilcox

@blt04
Copy link
Owner

blt04 commented Mar 14, 2012

Thanks for the pull request. I can see how this would work, but it could also have some unintended consequences. For example, what if /usr/local/rvm/bin/rvm doesn't exist (either because it the rvm installer failed or the user forgot to include the rvm module correctly)?

Run stages work for me. I can install RVM, a Ruby, a gemset and some gems on a virgin virtual machine with one puppet run.

@rwilcox
Copy link
Author

rwilcox commented Mar 14, 2012

While I agree that run stages should work, they don't for me. Take a look at my puppet manifest (https://github.com/rwilcox/vagrant_base/blob/master/manifests/lucid32.pp), and do my RVM stuff in a require => Stage["Main"] stage, and no dice.

RVM-Puppet for me errors out in some calculation phase, before it has installed any packages. (Running Puppet 2.7.11).

It's possible my manifest file is doing something wrong, which is why I got an error (in which case let me know and I'll fix up the documentation or add an example or something), but I'm not sure.

@blt04
Copy link
Owner

blt04 commented Mar 14, 2012

I don't see anything obvious. Maybe you could post the exact error message?

@rwilcox
Copy link
Author

rwilcox commented Mar 15, 2012

The error message: Could not find a default provider for rvm_gemset. If you want I can post a sample Vagrant project which shows this behavior.

@blt04
Copy link
Owner

blt04 commented Mar 19, 2012

I think that would be helpful (the sample vagrant project). I'm unable to reproduce the error you are seeing as is.

I'm going to close this pull request for now as I don't think it's the right approach. Run stages work for me. If you do post the vagrant setup that generates the bug, open a new issue and I'll take a look.

And thank you for the pull request, even if I didn't end up using it!

@blt04 blt04 closed this Mar 19, 2012
@rwilcox
Copy link
Author

rwilcox commented Mar 27, 2012

Post Issue #41, which includes a sample Vagrantfile + manifests. Let me know if you have any questions or comments, or figure out what I did wrong...

togga pushed a commit to togga/puppet-rvm that referenced this pull request Oct 20, 2014
only install curl if it isn't defined elsewhere
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

Successfully merging this pull request may close these issues.

2 participants