batcave: setup for rhel9 syncing
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
This commit is contained in:
parent
c067145fa1
commit
6b677313e9
3 changed files with 80 additions and 0 deletions
69
roles/batcave/files/rhel9-sync
Normal file
69
roles/batcave/files/rhel9-sync
Normal file
|
@ -0,0 +1,69 @@
|
|||
#!/bin/sh
|
||||
|
||||
##
|
||||
# Setup the directories we will sync down to.
|
||||
RHEL9SYNCDIR=/srv/web/repo/rhel/rhel9
|
||||
SYNCDIR=/var/cache/reposync/
|
||||
|
||||
##
|
||||
# Need to download the metadata and the modular data
|
||||
DNFOPTS='--download-metadata -m --setopt=module_platform_id="platform:el9"'
|
||||
# Need to set the arches we are going to sync down
|
||||
ARCHES="aarch64 ppc64le s390x x86_64"
|
||||
|
||||
|
||||
##
|
||||
# Do the deeds
|
||||
cd ${RHEL9SYNCDIR}
|
||||
|
||||
# Make the sync dir where dnf will drop stuff. This disappeared once
|
||||
# and caused the script to die so we do this explicitely now.
|
||||
mkdir -vp ${SYNCDIR}
|
||||
|
||||
##
|
||||
## Sync Out RHEL-9 for appropriate arches
|
||||
for A in ${ARCHES}; do
|
||||
|
||||
# In case we have a bad sync from before, make sure the old sync
|
||||
# data is destroyed.
|
||||
rm -rf ${SYNCDIR}/${A}
|
||||
|
||||
# Configuration files for yum4 should fit this pattern.
|
||||
CONF=yum4-batcave-rhel9-${A}.conf
|
||||
|
||||
# Setup the repos you are going to sync out of the config file in
|
||||
# this pattern. This makes it easier for koji configs later
|
||||
REPOS="rhel-9-for-${A}-appstream-rpms rhel-9-for-${A}-baseos-rpms codeready-builder-for-rhel-9-${A}-rpms"
|
||||
|
||||
# We do a 2 level reposync because batcave is RHEL-7 and reposync
|
||||
# is what is default. However reposync does not pull in certain
|
||||
# data so we have to repeat this with dnf to get the metadata
|
||||
# needed for modularity.
|
||||
for R in ${REPOS}; do
|
||||
echo "Syncing ${R} for ${A}"
|
||||
# Be verbose on errors.
|
||||
if [[ $? -ne 0 ]]; then
|
||||
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} --repoid=${R} -a ${A} -a noarch -a i686 -p ${A} &> /dev/null
|
||||
else
|
||||
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} --repoid ${R} -a ${A} -p ${A}"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
### Here we put in syncs which do not fit in with the general do this
|
||||
### for all architectures. In this case we only copy down openstack
|
||||
### for x86_64 and source because we really only care about rabbitmq
|
||||
### We put this in an 'other' directory so that grobisplitter and any
|
||||
### other tools don't accidently pull it into their work.
|
||||
|
||||
OTHERCONF=yum4-batcave-rhel9-other.conf
|
||||
|
||||
#dnf reposync -c ${RHEL8SYNCDIR}/${OTHERCONF} ${DNFOPTS} --repoid rhel-8-x86_64-openstack-16-rpms -a x86_64 -a noarch -a i686 -p other &> /dev/null
|
||||
#dnf reposync -c ${RHEL8SYNCDIR}/${OTHERCONF} ${DNFOPTS} --repoid rhel-8-srpms-openstack-16-rpms --source -a x86_64 -a noarch -a i686 -p other &> /dev/null
|
|
@ -1,2 +1,3 @@
|
|||
30 1 * * * root /mnt/fedora/app/fi-repo/rhel/rhel7/rhel7-sync > /dev/null
|
||||
30 3 * * * root /mnt/fedora/app/fi-repo/rhel/rhel8/rhel8-sync > /dev/null
|
||||
30 5 * * * root /mnt/fedora/app/fi-repo/rhel/rhel9/rhel9-sync > /dev/null
|
||||
|
|
|
@ -284,6 +284,16 @@
|
|||
- batcave
|
||||
- config
|
||||
when: inventory_hostname.startswith('batcave01')
|
||||
#
|
||||
# Setup rhel9 sync script.
|
||||
#
|
||||
|
||||
- name: setup rhel9 sync copy script
|
||||
copy: src=rhel9-sync dest=/mnt/fedora/app/fi-repo/rhel/rhel9/rhel9-sync mode=0775
|
||||
tags:
|
||||
- batcave
|
||||
- config
|
||||
when: inventory_hostname.startswith('batcave01')
|
||||
|
||||
#
|
||||
# sync-rhn cron job
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue