Does the 'rhel' in this line refer to the channel label? # Redhat Repos rpush rhel
Thanks, Rich -----Original Message----- From: spacewalk-list-boun...@redhat.com [mailto:spacewalk-list-boun...@redhat.com] On Behalf Of Frey, Evan Sent: Tuesday, August 18, 2009 9:56 AM To: spacewalk-list@redhat.com Subject: RE: [Spacewalk-list] Spacewalk & RHEL question This may need some tweaking for your environment. And as always YMMV. ########################################### Script to pull RPMS from RedHat **** NOTE **** If you break the operation, you will have to blitz the LOCK file or the directory will not be processed. #!/bin/bash UP2DATE=/usr/sbin/up2date DOWNLOAD=/nfs/apt RPM_DIR=RPMS.stable # this index is built for us using a buildrepo script that is only for building # our apt repo. You can generate this via cron (or whatever) with # find /opt/apt -name "*.rpm" > /opt/apt/FILEINDEX APT_INDEX=FILEINDEX # space separated list of channels server is permissioned to access and that you want to download CHANNELS="rhel-i386-as-3" for x in $CHANNELS; do unset BUILDLIST unset LIST if [ ! -d "$DOWNLOAD/$x/$RPM_DIR" ]; then mkdir -p "$DOWNLOAD/$x/$RPM_DIR" fi touch $DOWNLOAD/$x/LOCK LIST=`${UP2DATE} --nox --showall --channel=$x | sed -e 's/\s/\n/g'` for i in $LIST; do echo "Checking $i..." if [ -z "`grep $i $DOWNLOAD/$APT_INDEX | grep $x`" ]; then echo "$i not found, adding to the list" BUILDLIST="$BUILDLIST $i" else echo "$i Found, skipping..." fi done if [ ! -z "$BUILDLIST" ]; then ${UP2DATE} --download --nox --get --tmpdir=${DOWNLOAD}/$x/$RPM_DIR $BUILDLIST fi rm -f $DOWNLOAD/$x/LOCK done ########################################### ########################################### Script to push RPMS to Satellite #!/bin/bash # if you change this value, you have to change the 9 in CHANNEL=`echo ${i:9}` # to the count of the characters in the value +1 REPO=/opt/apt LASTRUN_LIST=/opt/RPMLIST.LASTRUN FULL_LIST=/opt/RPMLIST.FULL ERROR_LOG=/opt/RPM_ERRORLOG SERVER= # user with channel admin privileges RHN_USER= RHN_PASSWORD= echo "Start time - `date`" > $LASTRUN_LIST echo -e "==========================================================================\n ***NOTE*** AFTER IMPORTING THE BELOW PACKAGES, PLEASE DELETE THIS FILE\nStart time - `date`" >> $ERROR_LOG rpush() { for i in $REPO/$1*; do CHANNEL=`echo ${i:9}` unset LINE unset ITER ITER=${#CHANNEL} while [ $ITER -ne 0 ]; do if [ ! -z "$LINE" ]; then LINE="$LINE=" else LINE="=" fi ITER=$((ITER - 1)) done LINE="=====$LINE=====" echo $LINE >> $LASTRUN_LIST echo "==== $CHANNEL ====" >> $LASTRUN_LIST echo $LINE >> $LASTRUN_LIST for x in $i/RPMS.stable/*rpm; do if [ ! "`grep $x $FULL_LIST`" ]; then rhnpush -u $RHN_USER -p $RHN_PASSWORD -c $CHANNEL --server=http://$SERVER/APP $x > $ERROR_LOG.tmp 2>&1; grep "Error pushing" $ERROR_LOG.tmp >> $ERROR_LOG grep "You are not allowed to manage channel" $ERROR_LOG.tmp >> $ERROR_LOG cat $ERROR_LOG | uniq > $ERROR_LOG.tmp2 mv -f $ERROR_LOG.tmp2 $ERROR_LOG echo $x >> $LASTRUN_LIST echo $x >> $FULL_LIST rm -f $ERROR_LOG.tmp fi done done } # Redhat Repos rpush rhel echo "End time - `date`" >> $LASTRUN_LIST exit ########################################### ########################################### #!/bin/bash # if you change this value, you have to change the 9 in CHANNEL=`echo ${i:9}` # to the count of the characters in the value +1 REPO=/opt/apt ERROR_LOG=/opt/RPM_ERRORLOG REPROCESS_ERROR_LOG=/opt/RPM_ERRORLOG.REPROCESS SERVER= # user with channel admin privileges RHN_USER= RHN_PASSWORD= echo -e "==========================================================================\n ***NOTE*** AFTER IMPORTING THE BELOW PACKAGES, PLEASE DELETE THIS FILE\nStart time - `date`" >> $REPROCESS_ERROR_LOG.tmp FILES=`grep ".rpm" RPM_ERRORLOG | awk {'print $3'} | cut -d: -f1` for i in $FILES; do CHANNEL=`echo ${i:9}` rhnpush -u $RHN_USER -p $RHN_PASSWORD -c $CHANNEL --server=http://$SERVER/APP $i > $REPROCESS_ERROR_LOG.tmp 2>&1; grep "Error pushing" $REPROCESS_ERROR_LOG.tmp >> $REPROCESS_ERROR_LOG grep "You are not allowed to manage channel - $i" $REPROCESS_ERROR_LOG.tmp >> $REPROCESS_ERROR_LOG cat $REPROCESS_ERROR_LOG | uniq > $REPROCESS_ERROR_LOG.tmp2 mv -f $REPROCESS_ERROR_LOG.tmp2 $REPROCESS_ERROR_LOG rm -f $REPROCESS_ERROR_LOG.tmp done exit ########################################### I hope this helps ____________________________ From: spacewalk-list-boun...@redhat.com [mailto:spacewalk-list-boun...@redhat.com] On Behalf Of Jeff Moody Sent: Tuesday, August 18, 2009 7:41 AM To: spacewalk-list@redhat.com Subject: RE: [Spacewalk-list] Spacewalk & RHEL question I would very much appreciate those scripts. Thanks a bunch. ---- Jeff Moody Senior Systems Engineer EVS Corporation 5050 Poplar Avenue ,Suite 1600 Memphis, Tennessee 38157 (901) 259-2387 - 24x7 Helpdesk (901) 881-0919 - Office (901) 497-1444 - Cell jeff.mo...@evscorporation.com From: spacewalk-list-boun...@redhat.com [mailto:spacewalk-list-boun...@redhat.com] On Behalf Of Frey, Evan Sent: Monday, August 17, 2009 4:18 PM To: spacewalk-list@redhat.com Subject: Re: [Spacewalk-list] Spacewalk & RHEL question Ah, I misread your email. I thought you were trying to connect 1 client machine to multiple servers. All that said I am currently doing exactly what you are describing. I have it in a two stage setup. I have a box for each architecture downloading all rpms in subscribed channels and dumping it to a central repo. An rhnpush script is kicked off that then iterates through the reop and pushes all the deltas to their corresponding channels. Future development will just pull down the src rpms and rebuild in each environment. If you want I can send you the scripts and directions for setup. I've been using it for months with no issues. ________________________________ From: spacewalk-list-boun...@redhat.com To: spacewalk-list@redhat.com Sent: Mon Aug 17 16:52:43 2009 Subject: RE: [Spacewalk-list] Spacewalk & RHEL question The documentation I've seen are mailing list/web postings of people working on scripts to pull RHN packages to add to Spacewalk (rather than Satellite). ---- Jeff Moody Senior Systems Engineer EVS Corporation 5050 Poplar Avenue ,Suite 1600 Memphis, Tennessee 38157 (901) 259-2387 - 24x7 Helpdesk (901) 881-0919 - Office (901) 497-1444 - Cell jeff.mo...@evscorporation.com From: spacewalk-list-boun...@redhat.com [mailto:spacewalk-list-boun...@redhat.com] On Behalf Of Frey, Evan Sent: Monday, August 17, 2009 3:51 PM To: spacewalk-list@redhat.com Subject: Re: [Spacewalk-list] Spacewalk & RHEL question Configuration and management is done on clients that are registered with the spacewalk/satellite/rhn server. I don't believe that the client supports registering with multiple servers. I could be wrong but it seems like a potential package nightmare. If you have seen documentation outlining this, please post for I would be interested to read up. ________________________________ From: spacewalk-list-boun...@redhat.com To: spacewalk-list@redhat.com Sent: Mon Aug 17 16:14:34 2009 Subject: RE: [Spacewalk-list] Spacewalk & RHEL question So, is it impossible to run a RHEL box that gets its updates from RHN but is configured and monitored by Spacewalk? I have seen some different documentation on potential methods to sync the RHN packages to Spacewalk, but feel pretty confident that this is (1) in violation of the spirit of the Spacewalk project and (2) may invalidate the Red Hat Support agreements that my company already has in place. More than anything, I have yet to find another product/project with some of the monitoring abilities of Spacewalk and would like that level of monitoring on our RHEL servers. Thanks. ---- Jeff Moody Senior Systems Engineer EVS Corporation 5050 Poplar Avenue ,Suite 1600 Memphis, Tennessee 38157 (901) 259-2387 - 24x7 Helpdesk (901) 881-0919 - Office (901) 497-1444 - Cell jeff.mo...@evscorporation.com From: spacewalk-list-boun...@redhat.com [mailto:spacewalk-list-boun...@redhat.com] On Behalf Of Frey, Evan Sent: Monday, August 17, 2009 1:46 PM To: spacewalk-list@redhat.com Subject: RE: [Spacewalk-list] Spacewalk & RHEL question I think (and I may be wrong) that a client can only be registered to one spacewalk system. When I have accidentally tried to register a system that was previously registered, an error pops up warning me to use the --force option to re-register. The force option then unregisters my client from the original system and registers it to the forced system. Not sure if it removes it on the spacewalk/satellite server or just from the client config. ________________________________ From: spacewalk-list-boun...@redhat.com [mailto:spacewalk-list-boun...@redhat.com] On Behalf Of Jeff Moody Sent: Monday, August 17, 2009 2:17 PM To: spacewalk-list@redhat.com Subject: [Spacewalk-list] Spacewalk & RHEL question Are there any gotchas I should know about when registering a RHEL server with Spacewalk? Is it possible to use Spacewalk for config management and monitoring and still pull updates from RHN? I would assume that this shouldn't be an issue if I don't have a RHEL channel defined in Spacewalk and the updates should pull from RHN, but I didn't know if there was an issue I may run into by having the box registered to both systems. Thanks. ---- Jeff Moody Senior Systems Engineer EVS Corporation 5050 Poplar Avenue ,Suite 1600 Memphis, Tennessee 38157 (901) 259-2387 - 24x7 Helpdesk (901) 881-0919 - Office (901) 497-1444 - Cell jeff.mo...@evscorporation.com ________________________________ CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. It is neither an offer to buy or sell, nor a solicitation of an offer to buy or sell, any securities or any related financial instruments mentioned in it. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Unless otherwise indicated, copyright and any other intellectual property rights in its contents are the sole property of Mizuho Securities USA Inc. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). ________________________________ ________________________________ CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. It is neither an offer to buy or sell, nor a solicitation of an offer to buy or sell, any securities or any related financial instruments mentioned in it. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Unless otherwise indicated, copyright and any other intellectual property rights in its contents are the sole property of Mizuho Securities USA Inc. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). ________________________________ CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are confidential. It is neither an offer to buy or sell, nor a solicitation of an offer to buy or sell, any securities or any related financial instruments mentioned in it. If you are not the named recipient please notify the sender and immediately delete it. You may not disseminate, distribute, or forward this e-mail message or disclose its contents to anybody else. Unless otherwise indicated, copyright and any other intellectual property rights in its contents are the sole property of Mizuho Securities USA Inc. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Although we routinely screen for viruses, addressees should check this e-mail and any attachments for viruses. We make no representation or warranty as to the absence of viruses in this e-mail or any attachments. Please note that to ensure regulatory compliance and for the protection of our customers and business, we may monitor and read e-mails sent to and from our server(s). ##################################################################################### _______________________________________________ Spacewalk-list mailing list Spacewalk-list@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-list _______________________________________________ Spacewalk-list mailing list Spacewalk-list@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-list