-
Notifications
You must be signed in to change notification settings - Fork 102
Description
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