diff --git a/playbooks/roles/mirror-update/files/centos-mirror-update b/playbooks/roles/mirror-update/files/centos-mirror-update index 95e0919f9a..2e1914a9f1 100755 --- a/playbooks/roles/mirror-update/files/centos-mirror-update +++ b/playbooks/roles/mirror-update/files/centos-mirror-update @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +source /usr/share/mirror-update/functions.sh + MIRROR_VOLUME=$1 if [[ ${NO_TIMEOUT:-0} -eq 1 ]]; then @@ -91,7 +93,7 @@ done date --iso-8601=ns | $K5START tee $BASE/timestamp.txt echo "rsync completed successfully, running vos release." -k5start -t -f /etc/afsadmin.keytab service/afsadmin -- vos release -v $MIRROR_VOLUME +$VOS_RELEASE $MIRROR_VOLUME date --iso-8601=ns echo "Done." diff --git a/playbooks/roles/mirror-update/files/epel-mirror-update b/playbooks/roles/mirror-update/files/epel-mirror-update index e98ef73c6c..63b38c744d 100755 --- a/playbooks/roles/mirror-update/files/epel-mirror-update +++ b/playbooks/roles/mirror-update/files/epel-mirror-update @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +source /usr/share/mirror-update/functions.sh + MIRROR_VOLUME=$1 if [[ ${NO_TIMEOUT:-0} -eq 1 ]]; then @@ -88,7 +90,7 @@ echo "$SHA1SUM $BASE/$REPO/$REPOMD" | sha1sum -c - date --iso-8601=ns | $K5START tee $BASE/timestamp.txt echo "rsync completed successfully, running vos release." -k5start -t -f /etc/afsadmin.keytab service/afsadmin -- vos release -v $MIRROR_VOLUME +$VOS_RELEASE $MIRROR_VOLUME date --iso-8601=ns echo "Done." diff --git a/playbooks/roles/mirror-update/files/fedora-mirror-update b/playbooks/roles/mirror-update/files/fedora-mirror-update index 0fef6ca32a..55ff7e824b 100755 --- a/playbooks/roles/mirror-update/files/fedora-mirror-update +++ b/playbooks/roles/mirror-update/files/fedora-mirror-update @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +source /usr/share/mirror-update/functions.sh + MIRROR_VOLUME=$1 function echo_ts { @@ -37,7 +39,6 @@ BASE="/afs/.openstack.org/mirror/fedora" # https://pagure.io/releng/issue/7921 MIRROR="rsync://pubmirror2.math.uh.edu/fedora-buffet/fedora/linux" K5START="k5start -t -f /etc/fedora.keytab service/fedora-mirror -- ${TIMEOUT}" -VOS_RELEASE="ssh -i /root/.ssh/id_vos_release vos_release@afs01.dfw.openstack.org vos release " echo_ts "----- START FEDORA MIRROR RSYNC RUN -----" diff --git a/playbooks/roles/mirror-update/files/functions.sh b/playbooks/roles/mirror-update/files/functions.sh new file mode 100644 index 0000000000..9fefd29ef3 --- /dev/null +++ b/playbooks/roles/mirror-update/files/functions.sh @@ -0,0 +1,5 @@ +# +# Common definitions and functions for mirror-update scripts +# + +VOS_RELEASE="ssh -i /root/.ssh/id_vos_release vos_release@afs01.dfw.openstack.org vos release " diff --git a/playbooks/roles/mirror-update/files/opensuse-mirror-update b/playbooks/roles/mirror-update/files/opensuse-mirror-update index e55204fa40..424aa3e99c 100755 --- a/playbooks/roles/mirror-update/files/opensuse-mirror-update +++ b/playbooks/roles/mirror-update/files/opensuse-mirror-update @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +source /usr/share/mirror-update/functions.sh + MIRROR_VOLUME=$1 if [[ ${NO_TIMEOUT:-0} -eq 1 ]]; then @@ -131,7 +133,7 @@ $K5START rsync -rlptDvz \ date --iso-8601=ns | $K5START tee $BASE/timestamp.txt echo "rsync completed successfully, running vos release." -k5start -t -f /etc/afsadmin.keytab service/afsadmin -- vos release -v $MIRROR_VOLUME +$VOS_RELEASE $MIRROR_VOLUME date --iso-8601=ns echo "Done." diff --git a/playbooks/roles/mirror-update/files/yum-puppetlabs-mirror-update b/playbooks/roles/mirror-update/files/yum-puppetlabs-mirror-update index eebafc75ae..6ef69b192e 100755 --- a/playbooks/roles/mirror-update/files/yum-puppetlabs-mirror-update +++ b/playbooks/roles/mirror-update/files/yum-puppetlabs-mirror-update @@ -13,6 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +source /usr/share/mirror-update/functions.sh + MIRROR_VOLUME=$1 if [[ ${NO_TIMEOUT:-0} -eq 1 ]]; then @@ -58,7 +60,7 @@ $K5START rsync -rlptDvz \ date --iso-8601=ns | $K5START tee $BASE/timestamp.txt echo "rsync completed successfully, running vos release." -k5start -t -f /etc/afsadmin.keytab service/afsadmin -- vos release -v $MIRROR_VOLUME +$VOS_RELEASE $MIRROR_VOLUME date --iso-8601=ns echo "Done." diff --git a/playbooks/roles/mirror-update/tasks/rsync.yaml b/playbooks/roles/mirror-update/tasks/rsync.yaml index fbf49e326f..daaaffa37d 100644 --- a/playbooks/roles/mirror-update/tasks/rsync.yaml +++ b/playbooks/roles/mirror-update/tasks/rsync.yaml @@ -8,6 +8,22 @@ group: root mode: '0755' +- name: Create common function dir + file: + path: /usr/share/mirror-update + state: directory + owner: root + group: root + mode: '0755' + +- name: Copy in common functions + copy: + src: 'functions.sh' + dest: '/usr/share/mirror-update' + owner: root + group: root + mode: '0644' + - name: Set update script names set_fact: rsync_update_scripts: