[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Bulk install of Sun .pkg Packages with CFEngine
From: |
Dan Gilbert |
Subject: |
RE: Bulk install of Sun .pkg Packages with CFEngine |
Date: |
Wed, 28 Sep 2005 11:37:40 -0700 |
What about using pkg-get? (http://www.bolthole.com/solaris/) You could host
the repository on your Cfengine master or somewhere else via an HTTP server of
your choice and then feed lists of packages by class to pkg-get. Since pkg-get
deals with iterating through the package list, all you'd have to do would be to
define the packages that are in the class and then have cfengine do the rest....
Basic syntax: /opt/csw/bin/pkg-get <install upgrade compare> <space-separated
basenames of packages (bash, curl, aide, wget, etc....)
Since there are simple scripts that could be run to update the catalog of the
repository, you'd always have the latest approved packages available. It could
be done as a shellcommand or as its own config file. Here's what I do as a
shellcommand:
solaris2.6::
"/opt/csw/bin/pkg-get -U" # Updates repository catalog if needed
"/opt/csw/bin/pkg-get -u $(pkglist)"
How you decide to define the $pkglist is obviously up to you. Since my Sun
boxes all have the same purpose, I just modify the variable at the top of my
shellcommands.cf as needed. I have basic needs of cfengine, so not much needs
to happen dynamically.
Hope this is better/helps more than the last suggestion I made ;)
Dan Gilbert, GCIH, MCSE, CCA
Sr. Systems Engineer
Advanced iTV Systems/Production Operations
Digeo, Inc.
dan.gilbert@digeo.com
-----Original Message-----
From: Geoff Davis [mailto:gadavis@ucsd.edu]
Sent: Tuesday, September 27, 2005 10:35 AM
To: Dan Gilbert; greg
Cc: help-cfengine@gnu.org
Subject: Re: Bulk install of Sun .pkg Packages with CFEngine
Dan,
That was my plan initially. However pkgadd doesn't parse through
multiple *.pkg files (aka streamed packages). It seems to treat
a .pkg file logically like a directory containing unstreamed
packages. Thus, you use the -d option to specify a spool directory of
unstreamed files or a .pkg file. You cannot point pkgadd at a
directory full of .pkg files and expect it to Do The Right Thing (TM).
There's a couple of different approaches that can be taken to solve
this, I was just wondering if anybody had already rolled a solution
that I could steal.
Solution 1:
(as proposed by greg@doodoo.darktech.org in another email in this
thread)
Take all of my packages that I want to distribute, unstream them with
pkgtrans to convert them from multiple .pkg files to the directory-
based unstreamed format, then restream them back into one M-m-
mega .pkg file.
Pros:
This solves the problem of needing to copy a million and one files/
directories over, which cfengine does not excel at.
Cons:
The downside is that I have to generate this mega package file every
time I upgrade a package. It's further complicated by the fact that
my CFEngine master server is a Linux box, and thus it doesn't have
the Sun pkg_splat tools.
Solution 2:
Copy the various .pkg files over to the client to a junk directory,
then trigger a command action to use the unstreaming capability of
pkgadd to spool up the package files in /var/spool/pkg. So I would
copy all of the .pkg files to a junk directory, say /var/tmp/
packages, then run:
find /var/tmp/packages -name "*.pkg" -exec pkgadd -s /var/spool/pkg -
d \{\} \;
Pros:
This also solves the problem of not copying a million and one files
over, but does not require generating the m-m-mega package as
proposed in Solution 1.
Cons:
The downside is that now the package files are stored on the CFEngine
client systems in two different formats and two different locations.
Solution 3:
Copy the various .pkg files over to the client to some junk
directory. Then, write a wrapper around pkginfo and pkgadd that
generates a list of what .pkg file provides what packages, and use
that list to call pkgadd as necessary on a particular .pkg file. I
would then use this yet-to-be-written wrapper script as the
SUNInstallCommand.
Pros:
Packages aren't stored twice on the client, and it's easy to put a
new version of a package in place.
Cons:
It's not written yet (to my knowledge), and there might be some
trickiness with multiple .pkg files providing the same package.
So I guess to rephrase my question, has anyone written or know of a
magic script that does Solution 3?
Thanks,
Geoff
On Sep 26, 2005, at 4:25 PM, Dan Gilbert wrote:
> In Solaris 8 or 9, it seems you can do this:
>
> usage:
> pkgadd [-nvi] [-d device] [[-M] -R host_path] [-V fs_file]
> [-a admin_file] [-r response] [-x proxy] [-k keystore] [ -P passwd]
> [-Y category[,category ...] | pkg [pkg ...]]
> pkgadd -s dir [-d device] [-x proxy] [-k keystore] [-P
> passwd] [-Y category[,category ...] | pkg [pkg ...]]
>
> Why not clear out the /var/spool/pkg folder, copy your packages
> there, use an admin file that makes things non-interactive, and
> just use pkgadd <package list with spaces>?
>
> I've used that in the past on the command line, so I would infer
> that it could also be done via cfengine in some sort of class that
> looks for the packages with pkginfo and then copies and installs
> them if the target packages aren't there.
>
> Am I missing something in your orginal post?
>
> Dan Gilbert, GCIH
> Sr. Systems Engineer
> Advanced iTV Systems/Production Operations
> Digeo, Inc.
>
>
>
> -----Original Message-----
> From: help-cfengine-bounces+dan.gilbert=digeo.com@gnu.org
> [mailto:help-cfengine-bounces+dan.gilbert=digeo.com@gnu.org] On
> Behalf Of Geoff Davis
> Sent: Monday, September 26, 2005 4:11 PM
> To: help-cfengine@gnu.org
> Subject: Bulk install of Sun .pkg Packages with CFEngine
>
>
> Does anyone have a script or other trick for doing bulk installations
> of Sun packages in streamed format, a.k.a. the .pkg files? The Sun
> pkgadd command won't let you specify multiple packages to install on
> the command line unless they are all unstreamed packages.
>
> For example, if you have a bunch of .pkg files in /var/spool/pkg, you
> can't just say:
> pkgadd -d /var/spool/pkg SUNWfoo SUNWbar SUNWbaz
> because pkgadd isn't smart enough to look in the pile of .pkg files.
> It can only look in one .pkg file at a time with the -d option.
>
> I'm hesitant to just copy the .pkg files over and then unstream them
> on the client because I really don't want to have the package lying
> around in two forms if I don't need to. By the same token, I don't
> want to unstream the packages on the CFEngine server due to
> CFEngine's inefficiency in copying multiple files over. I'd rather
> just copy over the single streamed package than multiple
> subdirectories.
>
> Thanks,
> Geoff
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-
> cfengine
>