-
Notifications
You must be signed in to change notification settings - Fork 279
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
Use of run stage causing ordering problems #33
Comments
The puppet providers included in this module ( There are two supported ways for dealing with this problem:
I agree that having a module implement a run stage is probably not a great idea. I was trying to make the module easy to use without requiring too much configuration in manifest files. So I guess we have a few options:
I'm just thinking out loud. Thoughts? |
So I've been using method #1 (the two-pass install) as you describe above. What confuses me is the theory that run stages solve this, because I'm not seeing that. When I removed the "if $rvm_installed" logic from my node and try to rebuild it, with the rvm install in an early run stage, the whole manifest still blows up with: puppet-agent[1214]: Failed to apply catalog: Could not find a default provider for rvm_system_ruby Have you actually had success with getting run stages to install rvm before the manifest blows up due to lack of a provider? It's not working for me on puppet 2.6.12. |
Yes I have had success with run stages. It works great for me on 2.7.10. I'll admit I haven't tested it with older versions of puppet. I do still see the "Could not find a default provider for rvm_system_ruby" when running in Also, you may want to make sure you have pulled the latest changes from master, as I refactored it slightly a few days ago due to run stages not behaving correctly in 2.7.1. |
Interesting, maybe there is a difference between 2.6.12 and 2.7.10 with respect to run stages and providers. I'll have to test 2.7 at some point; for now I will continue to rely on the two-pass method. What I did to solve the run stage problem is parameterize the run stage used (defaulting to rvm-install). That way I can elect to supply my own run stage that has whatever ordering I want. That patch will be included with the rest as soon as I send you a pull request (no later than tomorrow hopefully). I do have the latest changes - I applaud the change of entry point into the module. Including "rvm::system" instead of "rvm" was kind of odd. |
It might be worth replacing: commands :rvmcmd => "/usr/local/rvm/bin/rvm" with: optional_commands :rvmcmd => "/usr/local/rvm/bin/rvm" That might prevent puppet from checking to see whether the rvm bin exists, helping you avoid run stages. |
Reference: blt04#33
My 2 cents to the discussion , since I got into some problems due to the stages usage in the module.
and explicit dependencies when using the types (precisely the rvm_system_ruby as a sane usage of the other types requires a ruby installed):
This approach worked well (not tested it widely), even if it requires the user to explicitly set dependencies, but that's something that it has already to be done for rvm_gem / rvm_gemsets types, so it would just involve one more require (require => Class['rvm::system'],) that can be quickly documented. Code is here: example42@be95623 |
Brandon, I've made some substantial modifications to puppet-rvm to add both support for using an RPM package as well as selinux support (everything is optional/backwards compatible), which I will make available soon in a pull request after additional testing. In the meantime, my testing has turned up a problem with run stages. My puppet environment uses a "pre" run stage to set up yum repos, otherwise every single package install would depend on those repos. The problem is that there is no relationship between my run stage and the one in your module, so it accidentally trumps my "pre" stage and then tries to install a bunch of RPMs from yum repos that don't exist yet, thus causing my puppet config to blow up when building a new box.
Can you explain the rationale behind the run stage? It seems like something that is better handled with dependencies, and I'm not sure that having a module implement a run stage is a good idea, but it's entirely possible that I haven't considered all the angles since I didn't write your module. :)
Thanks.
The text was updated successfully, but these errors were encountered: