Make Puppet 3.8.1 Use Ruby Version 2.1

25 views
Skip to first unread message

Dan Gibbons

unread,
Jun 19, 2015, 10:42:44 AM6/19/15
to puppet...@googlegroups.com
Hi,

I'm running a Centos 7 server, puppet 3.8.1 and Ruby 2.1.0 but I'm having problems trying to get puppet to parse my ruby template which uses open3.capture3 (only available in ruby versions greater than).

It looks like when i call me template like:
template("windows/get_ssl_thumbprint_by_friendlyname.erb") 

which contains:
<%
   require 'open3'

....
stdout,stderr,status = Open3.capture3(cmd)
...
-%>

Results in a server parse error:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template windows/get_ssl_thumbprint_by_friendlyname.erb:  Filepath: /etc/puppet/environments/vagrant/modules/windows/templates/get_ssl_thumbprint_by_friendlyname.erb
  Line: 11 Detail: undefined method `capture3' for Open3:Module


To me it looks like the server is parsing the template before handing to the client but it's using its built in ruby version of 1.8.7 which doesn't have the open3.capture3 method.

Is there any way I can get puppet to use the newer ruby version?

Thanks

Dan

Reply all
Reply to author
Forward
0 new messages