0

From the web UI and the documentation, spacewalk seems to want to download everything in a given repo regardless of relevance, which isn't so bad if you use all / most of the packages within a repo, but which is intense overkill if only one or two packages from a repo are used and the repo contains 10k packages.

In my particular case, I'd like to be able to keep only tomcat (within the epel repo) and its dependencies synced within its own subchannel, while leaving all the other, unnecessary epel packages untouched (and undownloaded).

This was the only way I found, but it seems like kind of a kludge and (creating a local repo to proxy the packages I'd want) and it isn't clear to me that that solution even accounts for dependencies gracefully (my gut tells me it doesn't).

edit: In case you're wondering how I can sustain such impressive confusion about a basic aspect of spacewalk, allow me to apprise you as to the state of the current documentation (as of this edit, those headings have nothing).

Parthian Shot
  • 1,165
  • 4
  • 16
  • 32

2 Answers2

0

I've solved this situation by having a separate cronjob download only the packages I need and putting them in a suitable existing repo. After downloading them I've run createrepo again to rebuild the repo indexes.

Script:

#!/bin/bash

CONFFILE="/local/etc/fetchextras.conf" # can be overridden
TARGETDIR="/tmp/repodl" 

read_config() {
    [[ -r $CONFFILE ]] || { echo "Can't read $CONFFILE, giving up..."; exit 1; }
    while read type value
    do
    [[ "$type" = "repo" ]] && ENABLE="--enablerepo $value $ENABLE"
    [[ "$type" = "package" ]] && PKGS="$value $PKGS"
    done < $CONFFILE
}


fetch_packages() {
    for pkg in $PKGS
    do
    yumdownloader -q -y --destdir=$TARGETDIR --disablerepo=* --resolve $ENABLE $pkg
    done
}

get_options() {
    CONFFILE=${1:-$CONFFILE}
}

get_options $@
read_config
fetch_packages

Configfile:

repo epel
package whatever
Jenny D
  • 27,780
  • 21
  • 75
  • 114
0

spacewalk includes cobbler. I usually use the repo config in there to filter out what I need; for older spacewalks at least.

Newer ones have a filter one can put RIGHT into the repo itself.

spacecmd {SSM:2}> repo_listfilters epel-6-64
spacecmd {SSM:2}> repo_addfilters epel-6-64 '+tomcat'
spacecmd {SSM:2}> repo_listfilters epel-6-64
+tomcat
spacecmd {SSM:2}> repo_clearfilters epel-6-64
spacecmd {SSM:2}> repo_listfilters epel-6-64
spacecmd {SSM:2}>

The UI bit is there for newer webUI.

Cobbler:

cobbler repo edit --name epel-6-64 --rpm-list 'tomcat'

... but that assumes you've added the repo to cobbler and you grab the spacewalk copy from localhost. Because it'll be localhost, and you will have two copies of tomcat, and you have to be okay with that.

Oh. There's never a need to bump like you do on forums.

user2066657
  • 336
  • 2
  • 13