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

run binaries from specific gem version... #64

Open
TJM opened this issue Oct 7, 2014 · 1 comment
Open

run binaries from specific gem version... #64

TJM opened this issue Oct 7, 2014 · 1 comment

Comments

@TJM
Copy link

TJM commented Oct 7, 2014

I have a puppet module (that is far from ready for human consumption) to setup Nginx, passenger, rails, etc... following the example that RVM has for Apache. I am still using this RVM module for all things RVM. I just copied the passenger section to my own module and modified it to work for nginx. One problem that I recently had was how to select a specific version of the passenger gem to run the "passenger-install-nginx" from...

I have something that looks like:

  $rvm = "${rvm_prefix}rvm/bin/rvm"
  $passenger_module = "${ruby_version}/gems/passenger-${passenger_version}"

  exec { 'passenger-install-nginx-module':
    command     => "${rvm} ${ruby_version} exec passenger-install-nginx-module --auto --auto-download --prefix=${nginx_prefix}",
    environment => 'HOME=/root',
    provider    => shell,
    unless      => "[ -x ${nginx_prefix}/sbin/nginx ] && ${nginx_prefix}/sbin/nginx -V 2>&1 | grep -q ${passenger_module}",
    logoutput   => 'on_failure',
    require     => Class['rvm::passenger::gem'],
    subscribe   => [ Class['rvm::passenger::gem'], Rvm_system_ruby[$ruby_version] ],
  }

... and all was well until one day I changed the yaml file that selects the passenger version (in error, but whatever) to a lower version number (4.0.41 instead of 4.0.45 or whatever). The problem was that each time puppet ran, it would try to re-run the passenger-install-nginx-module because it was specifically looking for 4.0.41, and each time it ran that exec, it would select the newest version.

Consider this is probably a support request for an RVM/ruby novice ;)

~tommy

@TJM
Copy link
Author

TJM commented Oct 7, 2014

I think the "subscribe" line is unneeded, another developer added that to attempt to detect ruby version changes... I added the "unless .... grep -q ${passenger_module}" part.. as that checks both ruby version and passenger module.

I think I could just do something like ${rvm_prefix}gems/${passenger_module}/bin/passenger-install-nginx_module ... but that "feels" wrong somehow? Is it?

Speaking of which, how does your apache version detect ruby/passenger version changes to recompile the module?

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

1 participant