Puppet: install the Rubygem package on a machine without pre-installed Rubygems

On a clean Debian system - without Rubygems installed - I want to install the Rubygem package with Puppet (version 2.7.13). Thus, the package has a "gem" as a package provider.

This is my manifest so far (I kept it simple):

# test.pp Package { ensure => 'installed' } package { 'rubygems' : name => 'rubygems', } package { 'libldap-ruby1.8' : name => 'libldap-ruby1.8', } package { 'libldap2-dev' : name => 'libldap2-dev', } package { 'libsasl2-dev' : name => 'libsasl2-dev', } package { 'libsasl2-modules-ldap' : name => 'libsasl2-modules-ldap', } # My Rubygem, with Provider type 'gem' package { 'ruby-ldap' : name => 'ruby-ldap', provider => 'gem', } Package [ 'rubygems' ] -> Package [ 'ruby-ldap' ] Package [ 'libldap2-dev' ] -> Package [ 'ruby-ldap' ] Package [ 'libsasl2-modules-ldap' ] -> Package [ 'ruby-ldap' ] 

When I test this manifest (with puppet apply --noop test.pp ), I get the following output:

 err: /Stage[main]//Package[ruby-ldap]: Provider gem is not functional on this host 

I broke through the network and found some information about Puppet + Rubygems (for example this ), but none of them helped me solve my problem, since none of them gave a real solution with some code.

I also tried using classes and steps (doing rubygem installation in the step before installing gem), but I always got Provider gem -error (but maybe I just used the steps the wrong way).

Can someone provide me with a working manifest that installs rubygems and any rubygem on a system without Rubygems, or at least the latest tips on how to get there?

+4
source share
1 answer

Although my problem should be fixed with Puppet 2.7.8 (I used 2.7.13) - see this question - I am pretty sure that I had this problem with 2.7.13.

I tried this on another machine with 2.7.14 installed, where I can successfully install the Rubygems and Rubygem package with Puppet.

0
source

Source: https://habr.com/ru/post/1411826/


All Articles