From 3762d3f7d14a21a3e36322e98d7422b5a74f68d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Fri, 8 Mar 2024 08:55:04 +0100 Subject: [PATCH] MM: use different crawls to include or exclude disabled hosts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- .../mirrormanager/templates/cron-crawler.yml | 1 + .../templates/primary-mirror-wrapper.sh | 2 +- vars/apps/mirrormanager.yml | 27 ++++++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml b/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml index e16317268c..6446586b9f 100644 --- a/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml +++ b/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml @@ -30,6 +30,7 @@ spec: - "{{ cronjob.timeout }}" - "--category" - "{{ cronjob.category }}" + - "--{{ cronjob.include_disabled | ternary('include', 'exclude') }}-disabled" - "crawl" env: # Defaults to 80 columns, not very readable diff --git a/roles/openshift-apps/mirrormanager/templates/primary-mirror-wrapper.sh b/roles/openshift-apps/mirrormanager/templates/primary-mirror-wrapper.sh index fbb81d4e56..698b87fbd3 100644 --- a/roles/openshift-apps/mirrormanager/templates/primary-mirror-wrapper.sh +++ b/roles/openshift-apps/mirrormanager/templates/primary-mirror-wrapper.sh @@ -84,7 +84,7 @@ fi # Rerun scan after 24 hours if [ "$LASTRUN" -gt "$FILEDATE" ] && [ "$LASTRUN" -gt $(expr $CURDATE - 86400) ]; then - # no changes on the master mirror + echo "No changes on the master mirror (${FFTL})" # abort exit 0 fi diff --git a/vars/apps/mirrormanager.yml b/vars/apps/mirrormanager.yml index ff872f654a..4ee7f029fd 100644 --- a/vars/apps/mirrormanager.yml +++ b/vars/apps/mirrormanager.yml @@ -6,29 +6,50 @@ mirrormanager_oidc_client_id: "mirrormanager" mm2_checkin: false mirrormanager_cron_crawler: - category: "Fedora Linux" - schedule: "0 */12 * * *" + schedule: "0 */12 * * 1-6" threads: 40 timeout: 600 + include_disabled: false + - category: "Fedora Linux" + schedule: "0 */12 * * 7" + threads: 40 + timeout: 660 + include_disabled: true - category: "Fedora Secondary Arches" schedule: "0 3,9 * * *" threads: 10 timeout: 300 + include_disabled: false - category: "Fedora EPEL" - schedule: "45 */6 * * *" + schedule: "45 */6 * * 1-6" threads: 20 timeout: 300 + include_disabled: false + - category: "Fedora EPEL" + schedule: "45 */6 * * 7" + threads: 20 + timeout: 300 + include_disabled: true - category: "Fedora Archive" schedule: "0 2 * * *" threads: 10 timeout: 600 + include_disabled: false - category: "Fedora Other" schedule: "0 14 * * *" threads: 20 timeout: 600 + include_disabled: false - category: "CentOS" - schedule: "0 5,11 * * *" + schedule: "0 5,11 * * 1-6" threads: 20 timeout: 300 + include_disabled: false + - category: "CentOS" + schedule: "0 5,11 * * 7" + threads: 20 + timeout: 300 + include_disabled: true mirrormanager_cron_primary_mirror: # check if category Fedora Linux needs updating every 30 minutes - category: "fedora"