Mailinglist Archive: opensuse (1702 mails)

< Previous Next >
Re: [opensuse] Looking for autoyast guide for CLI environments
  • From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
  • Date: Tue, 1 Sep 2009 03:50:38 -0500
  • Message-id: <200909010350.38856.drankinatty@xxxxxxxxxxxxxxxxxx>
On Monday 31 August 2009 07:37:20 am Simon Loewenthal/NL/Tele2 wrote:
Hi,

I am looking for a how to guide for setting up a autoyast server
that uses the CLI, not yast GUI. This makes sence because servers
usually won't have x11/gnome etc installed. None of our servers do.

The only guides I have found presume that all servers use the yast GUI.
E.g. http://support.novell.com/techcenter/articles/nc2006_03a.html
However, this won't help those that won't use the GUI.

Does anyone know where I can find such a guide.

Best regards, S


It's quite simple to do. (unless you add and need to manage the delta.rpm
availability -- that takes a little more effort). Basically, just set up your
repository structure directories:

[03:23 nirvana:/home/backup/rpms] # l openSUSE_11.0/
total 776
drwxr-xr-x 2 david dcr 77824 2009-08-09 04:02 delta/
drwxr-xr-x 2 david dcr 4096 2009-07-13 11:23 i386/
drwxr-xr-x 2 david skyline 155648 2009-08-30 01:52 i586/
drwxr-xr-x 2 david dcr 12288 2009-08-30 01:52 i686/
drwxr-xr-x 2 david dcr 69632 2009-08-30 01:52 noarch/
drwxr-xr-x 2 root root 4096 2009-08-30 01:53 repodata/
drwxr-xr-x 2 david dcr 4096 2009-08-08 02:01 src/
drwxr-xr-x 2 david skyline 425984 2009-08-29 21:56 x86_64/

Then put your files you want in your repo in the proper places (eg.):

[03:25 nirvana:/home/backup/rpms] # ls -1 openSUSE_11.0/x86_64/
akonadi-runtime-1.2.0-35.13.x86_64.rpm
akregator-4.3.0-156.6.x86_64.rpm
alpine-2.00-55.1.x86_64.rpm
alsa-1.0.19.git20090304-3.1.x86_64.rpm
alsa-devel-1.0.19.git20090304-3.1.x86_64.rpm


Then just create the repository metadat with "/usr/bin/createreop" The basic
format is: "createrepo [options] <directory>" For my example above it would be

createrepo --cachedir /home/backup/rpms/openSUSE_11.0/repodata \
--checkts --pretty --database /home/backup/rpms/openSUSE_11.0/

Now that you have the file metadata created, the repo is built, now you just
have to sign the repository:

# If you do not already have an established key, create one:

gpg -q --gen-key
MY_KEY=$( gpg --list-secret-keys | grep "^sec"|sed -e 's/.*\///;s/ .*//g;' \
| head -n 1 )

YAST REPOS SIGNING: This is here for completeness -- but use YUM below:

# From within your staging directory, sign the content and media.1/products
files and export the key

gpg --detach-sign -u MY_KEY -a content
gpg --export -a -u MY_KEY > content.key
gpg --detach-sign -u MY_KEY -a media.1/products
gpg --export -a -u MY_KEY > media.1/products.key

# export the key
gpg --export -a MY_KEY > gpg-pubkey-MY_KEY.asc


# In the <staging> directory, recreate the directory.yast file by typing:

ls -A1 -p > directory.yast

# In the <staging>/media.1 directory, recreate the directory.yast file by
typing:

ls -A1 -p > directory.yast


YUM REPO SIGNING:

# If you do not already have an established key, create one:

gpg -q --gen-key

VERSION=openSUSE_11.0
MY_KEY=$( gpg --list-secret-keys | grep "^sec"|sed -e 's/.*\///;s/ .*//g;' \
| head -n 1 )

# From within your staging directory, sign the content and media.1/products
files and export the key

gpg -a --detach-sign /home/backup/rpm/$VERSION/repodata/repomd.xml

# Export your key:

gpg -a --export $MY_KEY > /home/backup/rpm/$VERSION/repodata/repomd.xml.key


Your done and you have a new local repository in, for example
/home/backup/pathto/yourrepos. (Mine is /home/backup/rpms/openSUSE_11.0 for my
11.0 local files. Now from your clients, just issue the normal add repository
command of:

zypper ar http://home/backup/pathto/yourrepos

Now your client can update from the local repository without having to re-
download all the packages.

Notes: (1) your repo must be accessible from your web or ftpserver
(2) you will need to edit the repo file on each client
(/etc/zypp/repos.d/yourrepo and set a lower priority so zypper/yast check it
first for needed packages when selecting packages for the update or install.

Works great. Post again after a month or so if you need help removing the
duplicate rpms (ver-1-1.0.rpm, ver-1-1.1.rpm, etc...)

Good luck!

--
David C. Rankin, J.D.,P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
www.rankinlawfirm.com
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages