diff --git a/playbooks/roles/mirror-update/files/centos-mirror-update b/playbooks/roles/mirror-update/files/centos-mirror-update index eca6e26bed..73325b9d77 100755 --- a/playbooks/roles/mirror-update/files/centos-mirror-update +++ b/playbooks/roles/mirror-update/files/centos-mirror-update @@ -35,6 +35,15 @@ RSYNC="rsync ${_DRY_RUN} -rltvz" BASE="/afs/.openstack.org/mirror/centos" K5START="k5start -t -f /etc/centos.keytab service/centos-mirror -- $TIMEOUT" +if [[ ${DRY_RUN:-0} -ne 1 ]]; then + # Cleanup old repos + for REPO in 8 ; do + if [ -d $BASE/$REPO/ ]; then + $K5START rm -rf $BASE/$REPO/ + fi + done +fi + # # -- Centos 8-stream -- # @@ -54,25 +63,6 @@ $K5START ${RSYNC} \ --exclude=".*" \ $MIRROR $BASE/8-stream -# -# -- Centos 8 -- -# - -MIRROR=rsync://mirror.dal10.us.leaseweb.net/centos/8/ # somewhere in TX - -if ! [ -f $BASE/8 ]; then - $K5START mkdir -p $BASE/8 -fi -date --iso-8601=ns -echo "Running Centos 8 rsync..." -$K5START ${RSYNC} \ - --delete \ - --delete-excluded \ - --exclude="isos" \ - --exclude="ppc64le*" \ - --exclude=".*" \ - $MIRROR $BASE/8 - # # -- Centos 7 -- #