From ddc09175f39432ffdfce83e68be0e867191d3e0e Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Wed, 17 Jun 2020 08:36:10 -0400 Subject: [PATCH] Fix rhel6/rhel7 sync The old rhel sync scripts are built around RHEL-6 reposync which no longer exists. The scripts need to be updated to use dnf reposync and that uses different arguments. --- roles/batcave/files/rhel6-sync | 24 ++++++++++-------------- roles/batcave/files/rhel7-sync | 6 +++--- roles/batcave/files/rhel8-sync | 13 ++++++------- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/roles/batcave/files/rhel6-sync b/roles/batcave/files/rhel6-sync index 573bd04a47..649dc0629c 100644 --- a/roles/batcave/files/rhel6-sync +++ b/roles/batcave/files/rhel6-sync @@ -5,28 +5,24 @@ RHEL6CACHEDIR=/var/tmp/reposync-rhel6 cd $RHEL6SYNCDIR +DNFOPTS='--download-metadata -m --setopt=module_platform_id="platform:el6" -n' + mkdir -p ${RHEL6CACHEDIR} for i in i686 x86_64 ppc64; do mkdir -p ${RHEL6CACHEDIR}/${i} done -reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-i386.conf -t -n --download-metadata --repoid rhel-6-server-i386 -p i386 -a i686 --metadata-path ${RHEL6CACHEDIR}/i686 -reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-i386.conf -t -n --download-metadata --repoid rhel-6-server-optional-i386 -p i386 -a i686 --metadata-path ${RHEL6CACHEDIR}/i686 -# 2019-09-17 RHEL does not have these anymore for i386 -#reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-i386.conf -t -n --download-metadata --repoid rhel-6-server-ha-i386 -p i386 -a i686 -#reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-i386.conf -t -n --download-metadata --repoid rhel-6-server-lb-i386 -p i386 -a i686 +dnf reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-i386.conf ${DNFOPTS} --repoid=rhel-6-server-i386 -p i386 -a i686 --metadata-path ${RHEL6CACHEDIR}/i686 +dnf reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-i386.conf ${DNFOPTS} --repoid rhel-6-server-optional-i386 -p i386 -a i686 --metadata-path ${RHEL6CACHEDIR}/i686 -reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-x86_64.conf -t -n --download-metadata --repoid rhel-6-server-x86_64 -p x86_64 --metadata-path ${RHEL6CACHEDIR}/x86_64 -reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-x86_64.conf -t -n --download-metadata --repoid rhel-6-server-optional-x86_64 -p x86_64 --metadata-path ${RHEL6CACHEDIR}/x86_64 -reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-x86_64.conf -t -n --download-metadata --repoid rhel-6-server-ha-x86_64 -p x86_64 --metadata-path ${RHEL6CACHEDIR}/x86_64 -reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-x86_64.conf -t -n --download-metadata --repoid rhel-6-server-lb-x86_64 -p x86_64 --metadata-path ${RHEL6CACHEDIR}/x86_64 +dnf reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-x86_64.conf ${DNFOPTS} --repoid rhel-6-server-x86_64 -p x86_64 --metadata-path ${RHEL6CACHEDIR}/x86_64 +dnf reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-x86_64.conf ${DNFOPTS} --repoid rhel-6-server-optional-x86_64 -p x86_64 --metadata-path ${RHEL6CACHEDIR}/x86_64 +dnf reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-x86_64.conf ${DNFOPTS} --repoid rhel-6-server-ha-x86_64 -p x86_64 --metadata-path ${RHEL6CACHEDIR}/x86_64 +dnf reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-x86_64.conf ${DNFOPTS} --repoid rhel-6-server-lb-x86_64 -p x86_64 --metadata-path ${RHEL6CACHEDIR}/x86_64 -# -# rhel6 didn't have lb or ha repos for ppc64 -# -reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-ppc64.conf -t -n --download-metadata --repoid rhel-6-server-ppc64 -p ppc64 -a ppc64 --metadata-path ${RHEL6CACHEDIR}/ppc64 -reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-ppc64.conf -t -n --download-metadata --repoid rhel-6-server-optional-ppc64 -p ppc64 -a ppc64 --metadata-path ${RHEL6CACHEDIR}/ppc64 +dnf reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-ppc64.conf ${DNFOPTS} --repoid rhel-6-server-ppc64 -p ppc64 -a ppc64 --metadata-path ${RHEL6CACHEDIR}/ppc64 +dnf reposync -c $RHEL6SYNCDIR/yum-lockbox-rhel6-ppc64.conf ${DNFOPTS} --repoid rhel-6-server-optional-ppc64 -p ppc64 -a ppc64 --metadata-path ${RHEL6CACHEDIR}/ppc64 for i in `ls -d /srv/web/repo/rhel/rhel6/i386/*` do diff --git a/roles/batcave/files/rhel7-sync b/roles/batcave/files/rhel7-sync index b271641749..899f5b635a 100644 --- a/roles/batcave/files/rhel7-sync +++ b/roles/batcave/files/rhel7-sync @@ -5,7 +5,7 @@ SYNCDIR=/var/cache/reposync/ YUMDIR=/var/tmp/reposync-rhel7/ ## Need to download the metadata and the modular data -ROPTS='--download-metadata -m' +DNFOPTS='--download-metadata -m --setopt=module_platform_id="platform:el7"' # s390 isnt working yet ARCHES="ppc64le s390x x86_64" @@ -31,9 +31,9 @@ for A in ${ARCHES}; do grep -q ${R} ${RHEL7SYNCDIR}/${CONF} if [[ $? -eq 0 ]]; then echo "Syncing ${R} for ${A}" - reposync -c ${RHEL7SYNCDIR}/${CONF} --repoid ${R} -a ${A} -p ${A} --metadata-path ${YUMDIR}/${A} + dnf reposync -c ${RHEL7SYNCDIR}/${CONF} ${DNFOPTS} --repoid ${R} -a ${A} -p ${A} --metadata-path ${YUMDIR}/${A} if [[ $? -ne 0 ]]; then - echo "Something went wrong with reposync -c ${RHEL7SYNCDIR}/${CONF} --repoid ${R} -a ${A} -a noarch -p ${A} --metadata-path ${YUMDIR}/${A}" + echo "Something went wrong with reposync -c ${RHEL7SYNCDIR}/${CONF} ${DNFOPTS} --repoid ${R} -a ${A} -a noarch -p ${A} --metadata-path ${YUMDIR}/${A}" continue fi ## Try to create repo diff --git a/roles/batcave/files/rhel8-sync b/roles/batcave/files/rhel8-sync index 95bf77e7f1..da554ac7c9 100644 --- a/roles/batcave/files/rhel8-sync +++ b/roles/batcave/files/rhel8-sync @@ -41,19 +41,18 @@ for A in ${ARCHES}; do # needed for modularity. for R in ${REPOS}; do echo "Syncing ${R} for ${A}" - reposync -c ${RHEL8SYNCDIR}/${CONF} -r ${R} -a ${A} -p ${A} &> /dev/null # Be verbose on errors. if [[ $? -ne 0 ]]; then - echo "Something went wrong with reposync -c ${RHEL8SYNCDIR}/${CONF} -r ${R} -a ${A} -a noarch -p ${A}" + echo "Something went wrong with reposync -c ${RHEL8SYNCDIR}/${CONF} --repoid ${R} -a ${A} -a noarch -p ${A}" fi # x86_64 is 'special' because we have to tell it for i686 also. if [[ ${A} == 'x86_64' ]]; then - dnf reposync -c ${RHEL8SYNCDIR}/${CONF} ${DNFOPTS} --repo=${R} -a ${A} -a noarch -a i686 -p ${A} &> /dev/null + dnf reposync -c ${RHEL8SYNCDIR}/${CONF} ${DNFOPTS} --repoid=${R} -a ${A} -a noarch -a i686 -p ${A} &> /dev/null else - dnf reposync -c ${RHEL8SYNCDIR}/${CONF} ${DNFOPTS} --repo=${R} -a ${A} -a noarch -p ${A} &> /dev/null + dnf reposync -c ${RHEL8SYNCDIR}/${CONF} ${DNFOPTS} --repoid=${R} -a ${A} -a noarch -p ${A} &> /dev/null fi if [[ $? -ne 0 ]]; then - echo "Something went wrong with dnf reposync -c ${RHEL8SYNCDIR}/${CONF} -r ${R} -a ${A} -p ${A}" + echo "Something went wrong with dnf reposync -c ${RHEL8SYNCDIR}/${CONF} --repoid ${R} -a ${A} -p ${A}" fi done done @@ -66,5 +65,5 @@ done OTHERCONF=yum4-batcave-rhel8-other.conf -reposync -c ${RHEL8SYNCDIR}/${OTHERCONF} -r rhel-8-x86_64-openstack-16-rpms -a x86_64 -p other &> /dev/null -reposync -c ${RHEL8SYNCDIR}/${OTHERCONF} -r rhel-8-srpms-openstack-16-rpms --source -a x86_64 -p other &> /dev/null +dnf reposync -c ${RHEL8SYNCDIR}/${OTHERCONF} ${DNFOPTS} --repoid rhel-8-x86_64-openstack-16-rpms -a x86_64 -p other &> /dev/null +dnf reposync -c ${RHEL8SYNCDIR}/${OTHERCONF} ${DNFOPTS} --repoid rhel-8-srpms-openstack-16-rpms --source -a x86_64 -p other &> /dev/null