blt04/puppet-rvm — pull request #34 by ssnodgra (2012-02-09 00:21:19+00:00)
Title: Updates for rvm-rpm usage, selinux and other fixes

As promised, here are the updates for compatibility with RPM installs as well as adding selinux support for Redhat-ish systems. My apologies for the number of commits, I was experimenting with the best way to do things along the way.

The first requirement for RPM support was to make the whole thing independent of the rvm install location. In order to accomplish this, I created a new fact called rvm_binary which points to the rvm executable. Both the manifests and providers make use of this fact. Also, the variable $rvm::system::rvmpath contains the rvm installation path, normally /usr/local/rvm for a script install or /usr/lib/rvm for the RPM install. To get the packaged install, you set the use_pkg class parameter to true.

The other major bit is selinux support. This is conditional on the selinux fact, which will be true on selinux-enabled systems. The main part of this is accomplished by adding an after_install hook to rvm, which runs every time a ruby version is installed. It will adjust the selinux file contexts on the ruby directories. Also, there's an extra exec when building passenger, since the Apache-related executables need some special contexts. Note that I found a bug in rvm hooks along the way, see issues 744-745 on rvm for info.

This has all been tested on RHEL6. I have no Ubuntu systems so I would greatly appreciate it if you make sure I didn't break Ubuntu, and I'd more than welcome any other feedback/discussion on the changes. Thanks for providing this very helpful module!