1

Do you guys know how one might run r10k properly on a CEntOS 6.7 server with Puppet 3.6? Is that a contradiction in terms?

I checked the r10k source code's list of requirements: https://github.com/puppetlabs/r10k#requirements

It looks like it requires Ruby 1.9. Fair enough.

But...

$ facter rubysitedir rubyversion
rubysitedir => /usr/lib/ruby/site_ruby/1.8
rubyversion => 1.8

Thus begins the ignoble quest for the fabled Ruby.

Third Party Repositories

But most 3rd party repos don't offer Ruby 1.9 for CEntOS 6.7.

I failed to properly install The one package I did find, in good ol' Remi's repo, failed due to a lack of the mockbuild user. I would think that'd only be necessary if built from source.

Ruby 'managers'

I installed RVM.

That, however, required glibc = 2.12-1.166.el6_7.7, and my system does not have this particular version available (for good reasons).

Regardless, that would only have worked for specific users. Things could get weird with system users that need to use Ruby if RVM was installed. rbenv, which might have mitigated that issue, gave me the same guff about glibc:

$ mkdir ~/.tmp && export TMPDIR=~/.tmp && rbenv install 1.9.3-p551  ##  How did it come to this...
    Downloading yaml-0.1.6.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
Installing yaml-0.1.6...

BUILD FAILED (CentOS release 6.7 using ruby-build 20160913)

Inspect or clean up the working tree at /export/home/nger/.tmp/ruby-build.20161117064013.21057
Results logged to /home/nger/.tmp/ruby-build.20161117064013.21057.log

Last 10 log lines:
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/nger/.tmp/ruby-build.20161117064013.21057/yaml-0.1.6':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

System Ruby

ANYWAY, I then thought that I might be able to get away with using Ruby 1.8, CEntOS 6's system Ruby:

Monkey Patch for 1.8 :)

However, r10k devs later removed support for Ruby 1.8 :(

Puppet Collections

Next, at the behest of commenters, I checked the Puppet Collections documentation.

A. http://yum.puppetlabs.com/el/6/ has nothing for Ruby.

B. The puppet-agent package does not update the system Ruby, as (I thought?) advertised: enter image description here

enter image description here

HOWEVER, after installing, it looks like this does, indeed, produce a bespoke Ruby just for Puppet. Refer to the answer below for more details.

Is CEntOS 6 even supported by r10k?

Does CEntOS 6 support Ruby 1.9?

I'm close to giving up here, serverfault.com is my 'Hail Mary' play.

I have more options other than actual work, of course. I might just beg the RedHat package maintainers to update their Ruby, or pester certain people (you know who you are) to step up the pace on their CEntOS 7 efforts...

Notes:

Note 1: I did not find much on serverfault about this question. https://serverfault.com/search?q=r10k+on+CEntOS+6

Note 2: I have asked this as part of my research on the following prior question:

How do I add third party puppet modules without committing them to source control?

Nathan Basanese
  • 321
  • 1
  • 4
  • 19
  • 1
    Depending on what version of Puppet you are running, try running it with the Ruby that comes embedded in Puppet. – Florin Asăvoaie Nov 17 '16 at 00:37
  • // , 3.6. Doesn't seem to come with 1.9. Also, https://duckduckgo.com/?q=ruby+embedded+with+puppet doesn't yield much in the way of results. What do you mean by "the Ruby that comes embedded in Puppet."? I'm hanging out in the #r10k if you'd like to chat. – Nathan Basanese Nov 17 '16 at 00:49
  • 1
    Read up on [Puppet Collections](https://docs.puppet.com/puppet/latest/reference/puppet_collections.html). The versions in the PC1 repo definitely come with their own ruby. –  Nov 17 '16 at 00:58
  • // , Can I control the installation of modules on my puppet master without r10k? Can I use Puppetfile without r10k? Also, I read the documentation you listed. Looks like I may have a go at `[deadmanwalken@prodUT8qa]$ sudo rpm -Uvh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm`. – Nathan Basanese Nov 17 '16 at 01:01
  • // , MichaelHampton, fun? @yoonix, looks like http://yum.puppetlabs.com/el/6/ doesn't have any package for core Ruby, much less 1.9+. In that page, they list Ruby as one of the items updated with the installation of the puppet-agent package, https://docs.puppet.com/puppet/latest/reference/about_agent.html, but my test only shows facter, hiera, and puppet getting updated. – Nathan Basanese Nov 17 '16 at 02:54
  • 1
    This is gonna look ugly in a comment but.. `[root@ams1 ~]# rpm -qf /opt/puppetlabs/puppet/bin/ruby puppet-agent-1.8.0-1.el7.x86_64 [root@ams1 ~]# /opt/puppetlabs/puppet/bin/ruby -v ruby 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]` The URL I linked explains that ruby is in the puppet-agent rpm. That's on CentOS 7 but I'd expect the 6 version to be similar. –  Nov 17 '16 at 05:17
  • // , @yoonix Worked. Care to sum that up as an answer? I'll run it through again on a clean instance and if it works, accept. SDE may have mercy on my soul after all, lol – Nathan Basanese Nov 17 '16 at 05:59
  • // , I can do so with the "answer your own question" option, but that feels unfair to you. – Nathan Basanese Nov 17 '16 at 06:09
  • I'm fine with you summing it up if you'd like. I didn't really answer your original question, that's why I didn't post an answer. Just elaborated on @FlorinAsăvoaie's comment. –  Nov 17 '16 at 06:11

2 Answers2

1

r10k 1.5.1 is the last version to support ruby 1.8.7. Even if you gem install 1.5.1, newer-than-when-released dependencies will be installed, which are also incompatible with ruby 1.8.7. Obviously resulting in non-r10k errors, and the reason you may be looking at this answer.

yum install ruby-devel rubygems rubygem-rspec rubygem-rake
gem install --no-rdoc --no-ri semantic_puppet -v 0.1.3
gem install --no-rdoc --no-ri r10k -v 1.5.1
h0tw1r3
  • 2,746
  • 18
  • 17
0

The answer was in Puppet Collections, apparently:

$ curl -O https://yum.puppetlabs.com/puppetlabs-release-pc1-el-6.noarch.rpm
$ sudo rpm -ivh puppetlabs-release-pc1-el-6.noarch.rpm
$ sudo yum -d 1 install -y puppet-agent
$ /opt/puppetlabs/puppet/bin/ruby --version
ruby 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]

r10k will work just fine with this.

However, this gives you a later version of Puppet.

$ /opt/puppetlabs/bin/puppet --version
4.8.0

That cannot be resolved by force installing an earlier version of the puppet-agent package, though:

$ sudo yum info puppet-agent-1.0.0 | grep 'puppet ('
        : puppet (4.0.0)

The real answer, here, is to compile your own version of Ruby, and make it available to your system from FTP or an internal repo.

To answer the explicit question:

YES, YOU MAY INSTALL r10k ON CENTOS 6 USING CURL, RPM, AND YUM.

As to whether you can keep your old, dying Puppet 3.6, while doing so, that's still up in the air.

(Note: Some output has been intentionally omitted by The Management to protect the guilty and/or silly.)

Nathan Basanese
  • 321
  • 1
  • 4
  • 19