Enable propagation diagrams in MM2
Signed-off-by: Adrian Reber <adrian@lisas.de>
This commit is contained in:
parent
7ceec9fbd0
commit
6cc6e4417e
4 changed files with 44 additions and 4 deletions
|
@ -50,8 +50,16 @@
|
|||
- name: install the umdl-required logrotate file
|
||||
copy: src=mm2_umdl-required.logrotate dest=/etc/logrotate.d/mm2_umdl-required mode=644
|
||||
|
||||
- name: install sync to mirrorlist servers script
|
||||
template: src=sync_pkl_to_mirrorlists.sh dest=/usr/local/bin/sync_pkl_to_mirrorlists.sh mode=0755
|
||||
- name: install backend helper scripts
|
||||
template: src={{ item }} dest=/usr/local/bin/{{ item }} mode=0755
|
||||
with_items:
|
||||
- sync_pkl_to_mirrorlists.sh
|
||||
- handle_propagation.sh
|
||||
|
||||
- name: handle propagation cronjob
|
||||
cron: name="handle-propagation" minute="25,55" hour="*" user="mirrormanager"
|
||||
job="/usr/local/bin/handle_propagation.sh"
|
||||
cron_file=handle-propagation
|
||||
|
||||
- name: setup /var/lib/mirrormanager/.ssh directory
|
||||
copy: >
|
||||
|
|
32
roles/mirrormanager/backend/templates/handle_propagation.sh
Normal file
32
roles/mirrormanager/backend/templates/handle_propagation.sh
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
URL="https://admin.fedoraproject.org/pkgdb/api/collections/f*/?clt_status=Active"
|
||||
PROPAGATION="/usr/bin/mm2_propagation"
|
||||
SOURCE="mm-crawler01.phx2.fedoraproject.org::propagation"
|
||||
LOGBASE="/var/log/mirrormanager/propagation"
|
||||
|
||||
FRONTENDS="{% for host in groups['mm-frontend'] %} {{ host }} {% endfor %}"
|
||||
|
||||
OUTPUT=`mktemp -d`
|
||||
ACTIVE=`mktemp`
|
||||
|
||||
trap "rm -f ${OUTPUT}/*; rmdir ${OUTPUT}; rm -f ${ACTIVE}" QUIT TERM INT HUP EXIT
|
||||
|
||||
rsync -aq --delete ${SOURCE} ${LOGBASE}
|
||||
|
||||
curl -s ${URL} >> ${ACTIVE}
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "PROPAGATION: Querying the active collections failed. Exiting!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for version in `jq -r ".collections[$i].version" < ${ACTIVE}`; do
|
||||
${PROPAGATION} --outdir ${OUTPUT} --logfiles "${LOGBASE}/f${version}*" --prefix ${version}_updates
|
||||
done
|
||||
|
||||
${PROPAGATION} --outdir ${OUTPUT} --logfiles "${LOGBASE}/development*"
|
||||
|
||||
for f in ${FRONTENDS}; do
|
||||
rsync -aq ${OUTPUT}/*[st]-repomd-propagation.svg ${f}:/var/www/mirrormanager-statistics/data/propagation
|
||||
done
|
|
@ -57,7 +57,7 @@
|
|||
- config
|
||||
|
||||
- name: Create mirrormanager user
|
||||
user: name=mirrormanager state=present home=/var/lib/mirrormanager createhome=yes shell=/sbin/nologin
|
||||
user: name=mirrormanager state=present home=/var/lib/mirrormanager createhome=yes shell=/bin/bash
|
||||
tags:
|
||||
- mm2_frontend
|
||||
- config
|
||||
|
|
|
@ -97,7 +97,7 @@ INTERACTIVE_MAP = '/map/mirrors.html'
|
|||
# The crawler can generate propagation statistics which can be
|
||||
# converted into svg/pdf with mm2_propagation. These files
|
||||
# can be displayed next to the statistics and maps tab if desired.
|
||||
SHOW_PROPAGATION = False
|
||||
SHOW_PROPAGATION = True
|
||||
|
||||
# Where to look for the above mentioned propagation images.
|
||||
PROPAGATION_BASE = '/var/www/mirrormanager-statistics/data/propagation'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue