puppetdb puppet-terminus and updated ruby version

142 views
Skip to first unread message

JuanBrein

unread,
Jun 5, 2014, 8:09:13 AM6/5/14
to puppet...@googlegroups.com
HI guys,
On Ubuntu 12.04 using ruby 2.0 and puppet 3.3.2 through gem installation I can't find puppetdb-terminus . There is a 1.0 version but is empty available in rubygems.Does anybody know if there is an easy way to add this files to my puppet installation rather than just copy them over from the puppetdb-terminus deb package or source code?

Cheers

Juan

Ken Barber

unread,
Jun 5, 2014, 10:44:54 AM6/5/14
to Puppet Users
So we (as in the developers of PDB) don't manage the gem that was put
onto rubygems, someone else did this - pretty anti-social but alas
thats the way rubygems works :-).

In fact we normally don't promote ruby gems as a way of installing
this software (or puppet for that matter) but if you insist, someone
has provided a gemspec in our source tree, that you can build a gem
from: https://github.com/puppetlabs/puppetdb/blob/master/Gemfile.

ken.
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/e50b7fde-3a94-451a-aa07-6e9b375f5a9d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

JuanBrein

unread,
Jun 5, 2014, 11:37:46 AM6/5/14
to puppet...@googlegroups.com
I see, it is a gap in the installation though... I mean you can install ruby through RVM, then puppet as a gem, but you can't install puppetdb-terminus so you can't use it with puppetdb...

I did a quick:

  Rvm_gem<||> -> exec { "Install puppetdb-terminus":
    command     => "mkdir util/puppetdb;dpkg -L puppetdb-terminus|grep rb|while read a;do cp $a `echo $a|cut -d'/' -f7-`;done",
    cwd         => "/usr/local/rvm/gems/ruby-2.0.0-p451/gems/puppet-3.3.2/lib/puppet",
    path        => "/usr/bin:/bin",
    refreshonly => true,
    subscribe   => Package['puppetdb-terminus'],
  }


But it hurt my eyes each time I see it ... 

Suggestions?

jcbollinger

unread,
Jun 5, 2014, 4:56:34 PM6/5/14
to puppet...@googlegroups.com


On Thursday, June 5, 2014 10:37:46 AM UTC-5, JuanBrein wrote:
I see, it is a gap in the installation though...


For a non-recommended installation path.

 
I mean you can install ruby through RVM,


... but you shouldn't ...


then puppet as a gem,


... but you shouldn't ...

 
but you can't install puppetdb-terminus


... which is but one reason why not to do that.

 
so you can't use it with puppetdb...

I did a quick:

  Rvm_gem<||> -> exec { "Install puppetdb-terminus":
    command     => "mkdir util/puppetdb;dpkg -L puppetdb-terminus|grep rb|while read a;do cp $a `echo $a|cut -d'/' -f7-`;done",
    cwd         => "/usr/local/rvm/gems/ruby-2.0.0-p451/gems/puppet-3.3.2/lib/puppet",
    path        => "/usr/bin:/bin",
    refreshonly => true,
    subscribe   => Package['puppetdb-terminus'],
  }


But it hurt my eyes each time I see it ... 

Suggestions?


Install your whole Puppet stack, from Ruby through Puppet to Puppet DB, via your distro's native package management system.  PuppetLabs hosts package repositories for many current systems, including, I think, Ubuntu 12.04.  But be sure to avoid having the same thing installed as gem and native package.


John

Ken Barber

unread,
Jun 6, 2014, 6:00:51 AM6/6/14
to Puppet Users
>> But it hurt my eyes each time I see it ...
>>
>> Suggestions?
>
>
>
> Install your whole Puppet stack, from Ruby through Puppet to Puppet DB, via
> your distro's native package management system. PuppetLabs hosts package
> repositories for many current systems, including, I think, Ubuntu 12.04.
> But be sure to avoid having the same thing installed as gem and native
> package.

I concur with John, we recommend not using the gem at all for Puppet.

I think the main reason we have to keep publishing the gem for puppet
is for testing and development (like rspec-puppet testing for
example). But internally I know there is some dislike from our devs
around the gem way of installing puppet, because Puppet isn't just a
library in the conventional sense (its an app) and all the other
artifacts such as configuration files and service scripts can't be
contained in a gem for clean installation. Its another thing that can
go wrong basically, and when you're helping community users with
custom stuff you can waste a lot of time just in determining
environmental differences, not to mention we can never truly do
automated testing for everyones custom setups so the guarantees and
confidence here can only be lower ...... so it becomes a slight pain
for everyone :-).

On another note, gems require compilation steps - that is, any C
extensions etc. require compilation during installation. This is less
than desirable (unless you use gentoo :-) for a lot of shops to do due
to the tooling requirements needed, its flakiness, reduced determinism
... and not only that its much slower than installing a package with
just binaries. Also the upstream rubygems.org is flaky, so you always
need your own mirror (if you want reliability anyway).

I guess our expectations are that people who insist on using the gem
method, can support it themselves without help since its an advanced
thing and is usually only done for a specific reason, since as John
says - we provide packaging for the common recommended path.

Either way, I'm still offering the ability to build a gem here from
the Gemfile we provide in source, I guess you missed my comment before
about that:

"...but if you insist, someone has provided a gemspec in our source
tree, that you can build a gem from:
https://github.com/puppetlabs/puppetdb/blob/master/Gemfile"

And this can probably be hosted in a local gem mirror. If you're going
down the rubygems route for installation for your production
environment you'll need a mirror like this anyway since rubygems.org
can be flakey (we see it break all the time in our testing
environments) ... I guess my point is if you're going to insist on
doing gems, do it properly.

ken.

ps. of course if we had enough demand I'd totally consider supporting
gems, I'm a pragmatist don't get me wrong - just that up until now
no-one has convinced me its worth the effort, we're a small team as
well for puppetdb ... every decision around new action counts :-).

JuanBrein

unread,
Jun 6, 2014, 6:05:15 AM6/6/14
to puppet...@googlegroups.com
I've always used distribution packages, but now I need to use puppet_decrypt which is not supported by ruby 1.8.7

Quick question though... I've been looking in the documentation and I haven't found any note stating that installing puppet through gem is not recommended, neither using ruby > 1.8.7

RVM is just a wrapper to install ruby, so let just forget about it... Unfortunatelly ruby 2.0 is not available on Ubuntu 12.04 , so is either using rvm or compile it myself

Apart from that, bundlling puppetdb-terminus in a gem should be really easy and would allow full flexibility to be installed along puppet as gem on distributions where there are no packages available.

JuanBrein

unread,
Jun 6, 2014, 6:09:26 AM6/6/14
to puppet...@googlegroups.com
Ignore this last one, I wrote it at the same time you wrote your comment...

I understand and it makes sense.

Thanks for your help and I'll evaluate the strategy... I still need puppet_decrypt so I really need to figure how to integrate ruby 2.0.0 on ubutu 12.04 plus puppet. We use RVM for the rest of our ruby apps and that's why I thought on using it , but I see the cons as well.

Thanks for all your help!

Ken Barber

unread,
Jun 6, 2014, 6:14:43 AM6/6/14
to Puppet Users
> Ignore this last one, I wrote it at the same time you wrote your comment...
>
> I understand and it makes sense.
>
> Thanks for your help and I'll evaluate the strategy... I still need
> puppet_decrypt so I really need to figure how to integrate ruby 2.0.0 on
> ubutu 12.04 plus puppet. We use RVM for the rest of our ruby apps and that's
> why I thought on using it , but I see the cons as well.

And I think we've come to the heart of it ... 1 tool/library (out of
many that are fine?) is forcing your hand to do something strange. Is
it worth it? Well I guess thats your decision ... perhaps you could
just install Ubuntu 14.04 though, it has a good working ruby 1.9.3.

... actually you know what:

https://travis-ci.org/maxlinc/puppet-decrypt

If it doesn't work on Ruby 1.8.7, it certainly is being tested on that
platform, perhaps its a bug? It certainly seems like the authors
intention is to make it work on Ruby 1.8.7.

ken.

Ken Barber

unread,
Jun 6, 2014, 6:17:59 AM6/6/14
to Puppet Users
And another idea that I've seen people use is to install the Brightbox
PPA packages for Ruby:

http://brightbox.com/docs/ruby/ubuntu/

JuanBrein

unread,
Jun 6, 2014, 6:55:27 AM6/6/14
to puppet...@googlegroups.com
This is great... I see more options now! Thanks for the advice, really helpful
Reply all
Reply to author
Forward
0 new messages