Install and activate cronjob for daily mirror map creation
Signed-off-by: Adrian Reber <adrian@lisas.de>
This commit is contained in:
parent
b0af68b5f9
commit
a21c831e1c
2 changed files with 21 additions and 0 deletions
|
@ -55,12 +55,18 @@
|
|||
with_items:
|
||||
- sync_pkl_to_mirrorlists.sh
|
||||
- handle_propagation.sh
|
||||
- create_maps.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: create worldmap cronjob
|
||||
cron: name="create-worldmap" minute="50" hour="20" user="mirrormanager"
|
||||
job="/usr/local/bin/create-maps.sh"
|
||||
cron_file=create-worldmap
|
||||
|
||||
- name: setup /var/lib/mirrormanager/.ssh directory
|
||||
copy: >
|
||||
src="{{ private }}/files/mirrormanager/"
|
||||
|
|
15
roles/mirrormanager/backend/templates/create_maps.sh
Normal file
15
roles/mirrormanager/backend/templates/create_maps.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
WORLDMAP="/usr/bin/mm2_generate-worldmap"
|
||||
|
||||
FRONTENDS="{% for host in groups['mm-frontend'] %} {{ host }} {% endfor %}"
|
||||
|
||||
OUTPUT=`mktemp -d`
|
||||
|
||||
trap "rm -f ${OUTPUT}/*; rmdir ${OUTPUT}" QUIT TERM INT HUP EXIT
|
||||
|
||||
${WORLDMAP} --output ${OUTPUT} > /dev/null
|
||||
|
||||
for f in ${FRONTENDS}; do
|
||||
rsync -aq ${OUTPUT}/ ${f}:/var/www/mirrormanager-statistics/map
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue