How do I tell the mcollective server to use a different ruby path, or otherwise control the ruby environment?
I'm running on Centos 6.5, and have installed the ruby193 collection onto the servers and client. I'm trying to use the puppetlabs 'shell' agent (https://github.com/puppetlabs/mcollective-shell-agent), which requires Ruby 1.9.
When I try a simple 'ls' command like so:
mco shell run ls
All I get is:
* [ ================> ] 1/1
The shell application failed to run: undefined method `sort_by!' for #<Array:blahblahblah>
This looks to me like mcollective is defaulting to the system-installed Ruby 1.8, which is at /usr/bin/ruby
, and not using the PATH ruby which is somewhere under /opt/rh/ruby193.
When I installed the ruby193 collection it places a whole bunch of files in /opt/rh/ruby193, and requires source a script to set up. I've put the script in /etc/profile.d
, but I'm guessing mcollective isn't using that?
Any ideas/answered SF questions to point me at would be very helpful! Or a working 'shell' agent for mcollective, that would also do :). I'm simply trying to run a shell command on a specific (but dynamic) set of boxes!
In the end this was more trouble than it's worth - I've settled for installing RVM as a Multi-user install, and letting that handle all the relevant paths/gemsets for me. I had to do a bit of reinstalling gems to get Puppet to work again, but in the end it was less work than battling with SCL.