Switch EPEL to scan-primary-mirror (used to be umdl)
To support epel-next repositories this switches EPEL to use scan-primary-mirror instead of umdl. Signed-off-by: Adrian Reber <adrian@lisas.de>
This commit is contained in:
parent
138a1eddab
commit
1e85a2719f
3 changed files with 104 additions and 6 deletions
|
@ -1,5 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# This script checks for changes on the primary mirror and
|
||||||
|
# updates the database if changes are found. For most categories
|
||||||
|
# the script first checks if a fullfiletimelist-<category>
|
||||||
|
# exists and runs the actual primary mirror scan if that file
|
||||||
|
# has changed.
|
||||||
|
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
echo "Exactly two parameter needed. category and /path/to/logfile"
|
echo "Exactly two parameter needed. category and /path/to/logfile"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -9,12 +15,13 @@ exec >> $2
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
|
||||||
CURDATE=`date +%s`
|
CURDATE=`date +%s`
|
||||||
|
SCANNER="/usr/bin/mm2_update-master-directory-list"
|
||||||
|
|
||||||
if [ "${1}" == "fedora" ]; then
|
if [ "${1}" == "fedora" ]; then
|
||||||
CATEGORY="Linux"
|
CATEGORY="Linux"
|
||||||
elif [ "${1}" == "epel" ]; then
|
elif [ "${1}" == "epel" ]; then
|
||||||
CATEGORY="EPEL"
|
CATEGORY="EPEL"
|
||||||
|
SCANNER="/usr/local/bin/scan-primary-mirror"
|
||||||
elif [ "${1}" == "alt" ]; then
|
elif [ "${1}" == "alt" ]; then
|
||||||
CATEGORY="Other"
|
CATEGORY="Other"
|
||||||
elif [ "${1}" == "fedora-secondary" ]; then
|
elif [ "${1}" == "fedora-secondary" ]; then
|
||||||
|
@ -34,7 +41,7 @@ fi
|
||||||
|
|
||||||
# FULLFILETIMELIST -> FFTL
|
# FULLFILETIMELIST -> FFTL
|
||||||
if [ "${1}" == "codecs" ]; then
|
if [ "${1}" == "codecs" ]; then
|
||||||
/usr/local/bin/lock-wrapper umdl-${1} "/usr/bin/mm2_update-master-directory-list --category \"Fedora ${CATEGORY}\""
|
/usr/local/bin/lock-wrapper umdl-${1} "${SCANNER} --category \"Fedora ${CATEGORY}\""
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
FFTL="/srv/pub/${1}/fullfiletimelist-${1}"
|
FFTL="/srv/pub/${1}/fullfiletimelist-${1}"
|
||||||
|
@ -55,7 +62,7 @@ fi
|
||||||
echo -n "${FFTL} has changed since last run. Running umdl for Fedora ${CATEGORY} at "
|
echo -n "${FFTL} has changed since last run. Running umdl for Fedora ${CATEGORY} at "
|
||||||
date
|
date
|
||||||
|
|
||||||
/usr/local/bin/lock-wrapper umdl-${1} "/usr/bin/mm2_update-master-directory-list --category \"Fedora ${CATEGORY}\""
|
/usr/local/bin/lock-wrapper umdl-${1} "${SCANNER} --category \"Fedora ${CATEGORY}\""
|
||||||
|
|
||||||
if [ "$?" -eq "0" ]; then
|
if [ "$?" -eq "0" ]; then
|
||||||
# success! remember the date of this run
|
# success! remember the date of this run
|
||||||
|
|
|
@ -154,6 +154,13 @@
|
||||||
owner: mirrormanager
|
owner: mirrormanager
|
||||||
group: mirrormanager
|
group: mirrormanager
|
||||||
mode: 0600
|
mode: 0600
|
||||||
|
- name: install scan-primary-mirror configuration file
|
||||||
|
template:
|
||||||
|
src: scan-primary-mirror.toml
|
||||||
|
dest: /etc/mirrormanager/scan-primary-mirror.toml
|
||||||
|
owner: mirrormanager
|
||||||
|
group: mirrormanager
|
||||||
|
mode: 0600
|
||||||
- name: create /srv/mirrorlist-server.git
|
- name: create /srv/mirrorlist-server.git
|
||||||
file: path=/srv/mirrorlist-server.git state=directory owner=mirrormanager group=mirrormanager mode=0755
|
file: path=/srv/mirrorlist-server.git state=directory owner=mirrormanager group=mirrormanager mode=0755
|
||||||
- name: create /srv/scan-primary-mirror.git
|
- name: create /srv/scan-primary-mirror.git
|
||||||
|
@ -169,7 +176,7 @@
|
||||||
- name: checkout scan-primary-mirror
|
- name: checkout scan-primary-mirror
|
||||||
git:
|
git:
|
||||||
repo: https://github.com/adrianreber/scan-primary-mirror.git
|
repo: https://github.com/adrianreber/scan-primary-mirror.git
|
||||||
version: 0.1.0
|
version: 0.1.1
|
||||||
dest: /srv/scan-primary-mirror.git
|
dest: /srv/scan-primary-mirror.git
|
||||||
become: yes
|
become: yes
|
||||||
become_user: mirrormanager
|
become_user: mirrormanager
|
||||||
|
@ -197,7 +204,7 @@
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 755
|
mode: 0755
|
||||||
when: "mirrorlist_server_built is changed"
|
when: "mirrorlist_server_built is changed"
|
||||||
- name: install scan-primary-mirror
|
- name: install scan-primary-mirror
|
||||||
copy:
|
copy:
|
||||||
|
@ -206,5 +213,5 @@
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 755
|
mode: 0755
|
||||||
when: "scan_primary_mirror_built is changed"
|
when: "scan_primary_mirror_built is changed"
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
max_propagation_days = 2
|
||||||
|
max_stale_days = 3
|
||||||
|
excludes=[".*\\.snapshot", ".*/\\.~tmp~"]
|
||||||
|
skip_paths_for_version=["pub/alt"]
|
||||||
|
test_paths=["/test/", "/stage/"]
|
||||||
|
skip_repository_paths = ["Cloud", "Workstation", "Server", "drpms", "source"]
|
||||||
|
do_not_display_paths = ["_Beta"]
|
||||||
|
|
||||||
|
[database]
|
||||||
|
url="postgresql://{{ mirrormanager_db_user }}:{{ mirrormanager_db_pass }}@{{ mirrormanager_db_host }}/{{ mirrormanager_db_name }}"
|
||||||
|
|
||||||
|
### EPEL ###
|
||||||
|
|
||||||
|
[[category]]
|
||||||
|
name="Fedora EPEL"
|
||||||
|
type="directory"
|
||||||
|
url="/srv/pub/epel/"
|
||||||
|
|
||||||
|
[[repository_mapping]]
|
||||||
|
regex="pub/epel/testing/[\\d]/[^M].*"
|
||||||
|
prefix="testing-epel"
|
||||||
|
|
||||||
|
[[repository_mapping]]
|
||||||
|
regex="pub/epel/[\\d]/[^M].*"
|
||||||
|
prefix="epel"
|
||||||
|
|
||||||
|
[[repository_mapping]]
|
||||||
|
regex="pub/epel/[\\d]/Modular/.*"
|
||||||
|
prefix="epel-modular"
|
||||||
|
|
||||||
|
[[repository_mapping]]
|
||||||
|
regex="pub/epel/testing/next/[\\d]/Everything/.*"
|
||||||
|
prefix="epel-testing-next"
|
||||||
|
|
||||||
|
[[repository_mapping]]
|
||||||
|
regex="pub/epel/next/[\\d]/Everything/.*"
|
||||||
|
prefix="epel-next"
|
||||||
|
|
||||||
|
[[repository_mapping]]
|
||||||
|
regex="pub/epel/playground/[\\d]/Everything/.*"
|
||||||
|
prefix="epel-playground"
|
||||||
|
|
||||||
|
[[repository_mapping]]
|
||||||
|
regex="pub/epel/testing/[\\d]/Modular/.*"
|
||||||
|
prefix="testing-modular-epel"
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="testing-modular-epel-debug-"
|
||||||
|
to="testing-modular-debug-epel"
|
||||||
|
|
||||||
|
# The following repository_aliases are only necessary for EPEL
|
||||||
|
# because it has some unusual repository names.
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="epel-playground-"
|
||||||
|
to="playground-epel"
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="epel-playground-debug-"
|
||||||
|
to="playground-debug-epel"
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="epel-playground-source-"
|
||||||
|
to="playground-source-epel"
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="testing-modular-epel-source-"
|
||||||
|
to="testing-modular-source-epel"
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="testing-epel-debug-"
|
||||||
|
to="testing-debug-epel"
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="testing-epel-source-"
|
||||||
|
to="testing-source-epel"
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="testing-epel-"
|
||||||
|
to="testing-epel"
|
||||||
|
|
||||||
|
[[repository_aliases]]
|
||||||
|
from="testing-modular-epel-"
|
||||||
|
to="testing-modular-epel"
|
Loading…
Add table
Add a link
Reference in a new issue