Re: Solaris 10 and earlier Package management with Ruby.

113 views
Skip to first unread message

Geoff Hargreaves

unread,
Nov 21, 2012, 5:42:08 PM11/21/12
to puppe...@googlegroups.com
Perhaps I need to elaborate further.

I wish to build this wrapper and make a provider for puppet that will deal with pkg management for anything Solaris 10 and below in the same manner (roughly at first) as apt-get or yum.

Regards - Geoff


On Tuesday, 20 November 2012 13:43:49 UTC+11, Geoff Hargreaves wrote:
Hi Folks.

I may be in the wrong forum here but here goes.

I have seen entries on this topic over the web extolling the virtues of OpenCSW and Blastwave as yum and apt-get equivalents for Solaris. The problem I run into is the dependency tree for these products. I have been looking at OpenCSW and see it requires many packages from OpenCSW mirrors to run up pkgutil. In a largish environment with fairly strict policies on using pre-compiled binaries from external sources, I end up with SMC / CSW / SUNW / <our internal pkgs> in the mix and some unhappy legal / security staff.

The idea I would like to put forward is to write a wrapper  for pkgadd/pkgrm/pkginfo/etc.. in Ruby. Keeping it as separate from puppet as yum and apt-get to keep the model standard with a repo residing on a web server with a catalog. My reason for Ruby is that the solaris host that is a puppet client will already have Ruby installed so I have no extra guff to install on my closely guarded clients.

At this stage it is just something I was thinking about this morning. I would like to know if there is any interest in here for such a thing ? Am I insane ? Has it already been done ?

Regards - Geoff


Andy Parker

unread,
Nov 26, 2012, 2:03:58 PM11/26/12
to puppe...@googlegroups.com
On Wed, Nov 21, 2012 at 2:42 PM, Geoff Hargreaves <haa...@gmail.com> wrote:
Perhaps I need to elaborate further.

I wish to build this wrapper and make a provider for puppet that will deal with pkg management for anything Solaris 10 and below in the same manner (roughly at first) as apt-get or yum.


I don't know enough about packaging on Solaris to comment on your ideas for a packaging wrapper, but if it were to exist, having a puppet package provider for it seems like a good idea. Such a provider might reasonably be written as a module that could be put on the forge so that other puppet users can get it.
 
Regards - Geoff


On Tuesday, 20 November 2012 13:43:49 UTC+11, Geoff Hargreaves wrote:
Hi Folks.

I may be in the wrong forum here but here goes.

I have seen entries on this topic over the web extolling the virtues of OpenCSW and Blastwave as yum and apt-get equivalents for Solaris. The problem I run into is the dependency tree for these products. I have been looking at OpenCSW and see it requires many packages from OpenCSW mirrors to run up pkgutil. In a largish environment with fairly strict policies on using pre-compiled binaries from external sources, I end up with SMC / CSW / SUNW / <our internal pkgs> in the mix and some unhappy legal / security staff.

The idea I would like to put forward is to write a wrapper  for pkgadd/pkgrm/pkginfo/etc.. in Ruby. Keeping it as separate from puppet as yum and apt-get to keep the model standard with a repo residing on a web server with a catalog. My reason for Ruby is that the solaris host that is a puppet client will already have Ruby installed so I have no extra guff to install on my closely guarded clients.

At this stage it is just something I was thinking about this morning. I would like to know if there is any interest in here for such a thing ? Am I insane ? Has it already been done ?

Regards - Geoff


--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-dev/-/TOhCr70B4v0J.

To post to this group, send email to puppe...@googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Jeff McCune

unread,
Nov 26, 2012, 2:55:53 PM11/26/12
to puppe...@googlegroups.com
On Wed, Nov 21, 2012 at 2:42 PM, Geoff Hargreaves <haa...@gmail.com> wrote:
> Perhaps I need to elaborate further.
>
> I wish to build this wrapper and make a provider for puppet that will deal
> with pkg management for anything Solaris 10 and below in the same manner
> (roughly at first) as apt-get or yum.

It sounds like you're idea is to create a new package management
system that is like OpenCSW, but is built on top of Ruby instead of
Perl like pkgutil is built on top of.

I'm not sure you'll end up in a better situation if you take this
approach. Installing packages from an online repository requires a
fair amount of base functionality to get started. You probably want
an HTTP client library, some way to serialize and deserialize data
that contains information about the packages, and something that looks
like a database to keep track of all this stuff. The decision for
pkgutil to use Perl seems quite reasonable already; Perl is usually
installed on Solaris systems and it's provided by the OS vendor rather
than as a third party package. Likewise for wget.

Am I understanding the situation correctly? Honestly, I'm, a bit
surprised you're getting such a sprawling dependency graph. IIRC,
using pkgutil to bootstrap Ruby didn't require that many packages.

As another approach, you might also want to take a look at the
packages we provide for Solaris 10 in the Puppet Enterprise
distribution. These packages install Ruby and all of the dependencies
for Puppet without also requiring OpenCSW or other third party
packages.

Hope this helps,
-Jeff

Geoff Hargreaves

unread,
Nov 27, 2012, 11:09:44 PM11/27/12
to puppe...@googlegroups.com
Thanks for the reply.

I guess I have muddle my thinking a little. The dependency hell really only exists on the repo server. Installing pkgutilplus  (which has the scripts to build the catalog) has the extra dependencies. First Python then all of OpenCSW's python dependencies. A number of the dependencies are already installed via other packages re SMC or even in house  builds so I may be able to minimise the install base.

Regarding the sun.rb that already exists, we have many older Solaris versions that we will be trying to manage via puppet all the way back to 2.6. I think pkgadd only started dealing with http sources in 10. (would have been nice though).

So I guess my options are down to:

1> deal with the pain on 1 or 2 servers for the repo/catalog building stuff and install pkgutil on the clients without too many issues

2> I have a ruby script that will accept a file or url  argument (call it a ruby drop in for wget) that will do an md5sum check on what it has retrieved that is compared to a hash generated and sitting on the web server. I could extend the sun.rb to include the actual retrieval of the package via this 'ruby wget' that then continues on to the standard pkgadd/pkgrm/pkginfo commands. This would limit the need for installing extra packages (apart from the ruby script) but perhaps push the dependency checking into Puppet.

Will have to think on this for a bit.

Regards - Geoff

Geoff Hargreaves

unread,
Jan 20, 2013, 7:23:30 PM1/20/13
to puppe...@googlegroups.com
Hi Folks,

Just an update. I essentially wrote a wrapper for pkgadd in ruby that:
- Searches a web based repo for <pkg_name>
- if found, grabs the catalog line (includes pkg_name/file_name/md5sum/version)
- installs using an admin file (most likely delivered by puppet)

Then just wrote a provider that inherited from sun.rb that had a different install command, removed the need for a source argument and removed adminfile/responsefile/options from the install function.

Needs a little cleanup for sure but seems to work nicely.

Reason I chose this is method is I can now do the same for HP-UX and AIX with a minimal of effort. Also, this is for very OLD versions of Solaris, HP-UX and AIX. Better that I can have it all uniform.

Thanks for the input all, it has been helpful.

Regards - Geoff

Eric Sorenson

unread,
Jan 22, 2013, 4:55:02 PM1/22/13
to puppe...@googlegroups.com
Hi Geoff, this seems like interesting work -- is it up on github or the module Forge someplace?


Eric Sorenson - eric.s...@puppetlabs.com
#puppet irc: eric0 



--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-dev/-/7wUQrKYlvDAJ.
Reply all
Reply to author
Forward
0 new messages