diff --git a/files/download/sync-up-downloads.sh.ib01 b/files/download/sync-up-downloads.sh.ib01 new file mode 100755 index 0000000000..68eea2b33c --- /dev/null +++ b/files/download/sync-up-downloads.sh.ib01 @@ -0,0 +1,21 @@ +#!/bin/bash + +## +## This script is used to sync data from main download servers to +## secondary server at ibiblio. +## + +RSYNC='/usr/bin/rsync' +RS_OPT="-avSHP --numeric-ids" +RS_DEADLY="--delete --delete-excluded --delete-delay --delay-updates" +ALT_EXCLUDES="" +EPL_EXCLUDES="" +FED_EXCLUDES="" + +SERVER=dl.fedoraproject.org + +# The Buffet. +${RSYNC} ${RS_OPT} ${RS_DEADLY} ${ALT_EXCLUDES} ${SERVER}::fedora-buffet0/ /srv/pub/ | tail -n2 | logger -p local0.notice -t rsync_updates_alt_stg + +# Let MM know I'm all up to date +#/usr/bin/report_mirror diff --git a/playbooks/groups/download.yml b/playbooks/groups/download.yml index d898a7dfcf..e4910c3bf7 100644 --- a/playbooks/groups/download.yml +++ b/playbooks/groups/download.yml @@ -47,9 +47,12 @@ - include: "{{ tasks }}/2fa_client.yml" - include: "{{ tasks }}/motd.yml" when: env != "staging" - - name: put in script for syncing + - name: put in script for syncing on download-ib02 copy: src="{{ files }}/download/sync-up-downloads.sh" dest=/usr/local/bin/sync-up-downloads owner=root group=root mode=755 - when: datacenter == 'ibiblio' + when: inventory_hostname.startswith = 'download-ib02' + - name: put in script for syncing on download-ib01 + copy: src="{{ files }}/download/sync-up-downloads.sh.ib01" dest=/usr/local/bin/sync-up-downloads owner=root group=root mode=755 + when: inventory_hostname.startswith = 'download-ib01' - name: put in cron job for syncing copy: src="{{ files }}/download/download-sync.cron" dest=/etc/cron.d/download-sync owner=root group=root mode=644 when: datacenter == 'ibiblio'