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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Geoff Davis
Sent: Monday, September 26, 2005 4:11 PM
To: [email protected]
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
[email protected] http://lists.gnu.org/mailman/listinfo/help-
cfengine
_______________________________________________
Help-cfengine mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-cfengine